public abstract class AbstractParserContext extends Object implements ParserContext
Modifier and Type | Method and Description |
---|---|
CSResource |
createBaseResource(String expression)
Create a Concrete Syntax resource containing the parsed expression.
|
Attribution |
getAttribution(EObject eObject) |
Type |
getClassContext()
Return the type of the self variable.
|
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(EObject owner,
String expression)
Create an Abstract Syntax ExpressionInOCL containing the parsed expression on behalf of a potential owner.
|
void |
setRootElement(Element rootElement) |
public CSResource createBaseResource(String expression) throws IOException, ParserException
ParserContext
createBaseResource
in interface ParserContext
IOException
- if resource loading failsParserException
public Attribution getAttribution(EObject eObject)
getAttribution
in interface ParserContext
public Type getClassContext()
ParserContext
getClassContext
in interface ParserContext
public EnvironmentFactoryInternal getEnvironmentFactory()
ParserContext
getEnvironmentFactory
in interface ParserContext
public ExpressionInOCL getExpression(CSResource resource) throws ParserException
ParserContext
getExpression
in interface ParserContext
ParserException
- if parsing failspublic Type getInstanceContext()
public PivotMetamodelManager getMetamodelManager()
ParserContext
getMetamodelManager
in interface ParserContext
public Element getRootElement()
ParserContext
getRootElement
in interface ParserContext
public void initialize(Base2ASConversion conversion, ExpressionInOCL expression)
ParserContext
initialize
in interface ParserContext
public ExpressionInOCL parse(EObject owner, 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(Element rootElement)
setRootElement
in interface ParserContext
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.