Class ExpressionContext
- java.lang.Object
-
- com.nomagic.magicdraw.expressions.evaluation.ExpressionContext
-
@OpenApiAll public class ExpressionContext extends java.lang.Object
Expression context used to create expressions.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONTEXT_METACLASS
static java.lang.String
EXPRESSION_SOURCE
private java.util.Map<java.lang.String,java.lang.Object>
mContent
private ExpressionContext
mParent
static java.lang.String
PROJECT
static java.lang.String
THIS
-
Constructor Summary
Constructors Constructor Description ExpressionContext(Project project)
Constructor.ExpressionContext(ExpressionContext parent)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
add(java.lang.String key, java.lang.Object value)
Add value to the current context.ExpressionContext
copy()
Create this context copy.java.lang.Object
get(java.lang.String key)
Get the value from current context, or parent context if current context has no value.(package private) java.util.Map<java.lang.String,java.lang.Object>
getContent()
Gets the content of this context.java.util.Set<java.lang.String>
getKeys()
Context keys.(package private) ExpressionContext
getParent()
Gets the parent of this context.Project
getProject()
Get project - identical toget(PROJECT)
.
-
-
-
Field Detail
-
THIS
public static final java.lang.String THIS
- See Also:
- Constant Field Values
-
PROJECT
public static final java.lang.String PROJECT
- See Also:
- Constant Field Values
-
CONTEXT_METACLASS
public static final java.lang.String CONTEXT_METACLASS
- See Also:
- Constant Field Values
-
EXPRESSION_SOURCE
public static final java.lang.String EXPRESSION_SOURCE
- See Also:
- Constant Field Values
-
mParent
@CheckForNull private final ExpressionContext mParent
-
mContent
private final java.util.Map<java.lang.String,java.lang.Object> mContent
-
-
Constructor Detail
-
ExpressionContext
public ExpressionContext(@CheckForNull ExpressionContext parent)
Constructor.- Parameters:
parent
- parent context.
-
ExpressionContext
public ExpressionContext(Project project)
Constructor.- Parameters:
project
- project.
-
-
Method Detail
-
add
@CheckForNull public java.lang.Object add(java.lang.String key, @CheckForNull java.lang.Object value)
Add value to the current context.- Parameters:
key
- key.value
- value.- Returns:
- the previous value associated with key.
-
get
@CheckForNull public java.lang.Object get(java.lang.String key)
Get the value from current context, or parent context if current context has no value.- Parameters:
key
- key.- Returns:
- the value associated with key.
-
copy
public ExpressionContext copy()
Create this context copy.- Returns:
- copy.
-
getProject
public Project getProject()
Get project - identical toget(PROJECT)
.- Returns:
- project.
-
getKeys
public java.util.Set<java.lang.String> getKeys()
Context keys.- Returns:
- keys.
-
getParent
@CheckForNull ExpressionContext getParent()
Gets the parent of this context.- Returns:
- parent context.
-
getContent
java.util.Map<java.lang.String,java.lang.Object> getContent()
Gets the content of this context.- Returns:
- content.
-
-