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 |
|---|---|
protected void |
addAttribution(org.eclipse.emf.ecore.EClass eClass,
Attribution attribution) |
CSResource |
createBaseResource(java.lang.String expression)
Create a Concrete Syntax resource containing the parsed expression.
|
Attribution |
getAttribution(org.eclipse.emf.ecore.EObject eObject) |
Type |
getClassContext()
Return the type of the self variable.
|
protected java.lang.String |
getDoSetupMessage() |
EnvironmentFactoryInternal |
getEnvironmentFactory()
Return the EnvironmentFactory in use.
|
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)
protected void addAttribution(org.eclipse.emf.ecore.EClass eClass,
@NonNull
Attribution attribution)
@NonNull public CSResource createBaseResource(@NonNull java.lang.String expression) throws java.io.IOException, ParserException
ParserContextcreateBaseResource in interface ParserContextjava.io.IOException - if resource loading failsParserException@NonNull public Attribution getAttribution(@NonNull org.eclipse.emf.ecore.EObject eObject)
getAttribution in interface ParserContext@Nullable public Type getClassContext()
ParserContextgetClassContext in interface ParserContext@NonNull protected java.lang.String getDoSetupMessage()
@NonNull public EnvironmentFactoryInternal getEnvironmentFactory()
ParserContextgetEnvironmentFactory in interface ParserContext@Nullable public Type getInstanceContext()
@NonNull public ExpressionInOCL getExpression(@NonNull CSResource resource) throws ParserException
ParserContextgetExpression in interface ParserContextParserException - if parsing fails@NonNull public PivotMetamodelManager getMetamodelManager()
ParserContextgetMetamodelManager in interface ParserContext@Nullable public Element getRootElement()
ParserContextgetRootElement in interface ParserContextpublic void initialize(@NonNull
Base2ASConversion conversion,
@NonNull
ExpressionInOCL expression)
ParserContextinitialize 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 ParserContextParserException - if parsing failspublic void setRootElement(@Nullable
Element rootElement)
setRootElement in interface ParserContext