public abstract class AbstractParserContext extends java.lang.Object implements ParserContext
Modifier and Type | Field and Description |
---|---|
protected EnvironmentFactoryInternal |
environmentFactory |
protected Element |
rootElement |
protected org.eclipse.emf.common.util.URI |
uri |
Modifier | Constructor and Description |
---|---|
protected |
AbstractParserContext(EnvironmentFactory environmentFactory,
org.eclipse.emf.common.util.URI uri) |
Modifier and Type | Method and Description |
---|---|
CSResource |
createBaseResource(java.lang.String expression)
Create a Concrete Syntax resource containing the parsed expression.
|
Type |
getClassContext()
Return the type of the self variable.
|
protected java.lang.String |
getDoSetupMessage() |
EnvironmentFactoryInternal |
getEnvironmentFactory() |
ExpressionInOCL |
getExpression(CSResource resource)
Extract an Abstract Syntax ExpressionInOCL fronm a Concrete Syntax resource.
|
Type |
getInstanceContext() |
PivotMetamodelManager |
getMetamodelManager()
Return the MetamodelManager in use.
|
Element |
getRootElement()
Optional pre-existing AS root element to be updated by the parse.
|
void |
initialize(Base2ASConversion conversion,
ExpressionInOCL expression)
Callback to initialize the ExpressionInOCL with the derived context such as
a contextvariable for the self type, parameter and result variables.
|
ExpressionInOCL |
parse(org.eclipse.emf.ecore.EObject owner,
java.lang.String expression)
Create an Abstract Syntax ExpressionInOCL containing the parsed expression on behalf of a potential owner.
|
void |
setRootElement(Element rootElement) |
@NonNull protected final EnvironmentFactoryInternal environmentFactory
@NonNull protected final org.eclipse.emf.common.util.URI uri
@Nullable protected Element rootElement
protected AbstractParserContext(@NonNull EnvironmentFactory environmentFactory, @Nullable org.eclipse.emf.common.util.URI uri)
@NonNull public CSResource createBaseResource(@NonNull java.lang.String expression) throws java.io.IOException, ParserException
ParserContext
createBaseResource
in interface ParserContext
java.io.IOException
- if resource loading failsParserException
@Nullable public Type getClassContext()
ParserContext
getClassContext
in interface ParserContext
@NonNull protected java.lang.String getDoSetupMessage()
@NonNull public EnvironmentFactoryInternal getEnvironmentFactory()
@Nullable public Type getInstanceContext()
@NonNull public ExpressionInOCL getExpression(@NonNull CSResource resource) throws ParserException
ParserContext
getExpression
in interface ParserContext
ParserException
- if parsing fails@NonNull public PivotMetamodelManager getMetamodelManager()
ParserContext
getMetamodelManager
in interface ParserContext
@Nullable public Element getRootElement()
ParserContext
getRootElement
in interface ParserContext
public void initialize(@NonNull Base2ASConversion conversion, @NonNull ExpressionInOCL expression)
ParserContext
initialize
in interface ParserContext
@NonNull public ExpressionInOCL parse(@Nullable org.eclipse.emf.ecore.EObject owner, @NonNull java.lang.String expression) throws ParserException
ParserContext
This an invariant/precondition may specify its constraint as the owner
an operation body may specify the operation as the owner
The owner should be non-null but a null value is tolerated for deprecated compatibility.
parse
in interface ParserContext
ParserException
- if parsing failspublic void setRootElement(@Nullable Element rootElement)
setRootElement
in interface ParserContext