public interface ParserContext
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.
|
ExpressionInOCL |
getExpression(CSResource resource)
Extract an Abstract Syntax ExpressionInOCL fronm a Concrete Syntax resource.
|
MetamodelManager |
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 CSResource createBaseResource(@NonNull java.lang.String expression) throws java.io.IOException, ParserException
java.io.IOException
- if resource loading failsParserException
@Nullable Type getClassContext()
@Nullable ExpressionInOCL getExpression(@NonNull CSResource resource) throws ParserException
ParserException
- if parsing fails@NonNull MetamodelManager getMetamodelManager()
@Nullable Element getRootElement()
void initialize(@NonNull Base2ASConversion conversion, @NonNull ExpressionInOCL expression)
@NonNull ExpressionInOCL parse(@Nullable org.eclipse.emf.ecore.EObject owner, @NonNull java.lang.String expression) throws ParserException
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.
ParserException
- if parsing failsvoid setRootElement(@Nullable Element rootElement)