Package org.eclipse.epsilon.eol.dom
Class Operation
- java.lang.Object
-
- org.eclipse.epsilon.common.module.AbstractModuleElement
-
- org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
-
- org.eclipse.epsilon.eol.dom.Operation
-
- All Implemented Interfaces:
ModuleElement
,ICompilableModuleElement
- Direct Known Subclasses:
TemplateOperation
public class Operation extends AnnotatableModuleElement implements ICompilableModuleElement
-
-
Field Summary
Fields Modifier and Type Field Description protected StatementBlock
body
protected java.util.Map<java.lang.Object,java.lang.Object>
cache
protected EolType
contextType
protected TypeExpression
contextTypeExpression
protected java.util.List<Parameter>
formalParameters
protected boolean
isCached
protected NameExpression
nameExpression
protected EolType
returnType
protected TypeExpression
returnTypeExpression
-
Fields inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
annotationBlock
-
-
Constructor Summary
Constructors Constructor Description Operation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
build(AST cst, IModule module)
protected void
checkResultType(java.lang.Object result, IEolContext context)
void
clearCache()
void
compile(IEolCompilationContext context)
protected void
evaluatePostConditions(IEolContext context, java.lang.Object result)
protected void
evaluatePreConditions(IEolContext context)
java.lang.Object
execute(java.lang.Object self, java.util.List<?> parameterValues, IEolContext context)
java.lang.Object
execute(java.lang.Object self, java.util.List<?> parameterValues, IEolContext context, boolean inNewStackFrame)
protected java.lang.Object
executeBody(IEolContext context)
StatementBlock
getBody()
EolType
getContextType(IEolContext context)
TypeExpression
getContextTypeExpression()
java.util.List<Parameter>
getFormalParameters()
java.lang.String
getName()
NameExpression
getNameExpression()
EolType
getReturnType(IEolContext context)
TypeExpression
getReturnTypeExpression()
boolean
isCached()
void
setBody(StatementBlock body)
void
setContextTypeExpression(TypeExpression contextTypeExpression)
void
setNameExpression(NameExpression nameExpression)
void
setReturnTypeExpression(TypeExpression returnTypeExpression)
java.lang.String
toString()
-
Methods inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
getAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlock
-
Methods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
equals, getChildren, getComments, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, hashCode, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
nameExpression
protected NameExpression nameExpression
-
contextTypeExpression
protected TypeExpression contextTypeExpression
-
returnTypeExpression
protected TypeExpression returnTypeExpression
-
contextType
protected EolType contextType
-
returnType
protected EolType returnType
-
body
protected StatementBlock body
-
formalParameters
protected java.util.List<Parameter> formalParameters
-
isCached
protected boolean isCached
-
cache
protected java.util.Map<java.lang.Object,java.lang.Object> cache
-
-
Method Detail
-
build
public void build(AST cst, IModule module)
- Specified by:
build
in interfaceModuleElement
- Overrides:
build
in classAnnotatableModuleElement
-
compile
public void compile(IEolCompilationContext context)
- Specified by:
compile
in interfaceICompilableModuleElement
-
clearCache
public void clearCache()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractModuleElement
-
isCached
public boolean isCached()
-
execute
public java.lang.Object execute(java.lang.Object self, java.util.List<?> parameterValues, IEolContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
execute
public java.lang.Object execute(java.lang.Object self, java.util.List<?> parameterValues, IEolContext context, boolean inNewStackFrame) throws EolRuntimeException
- Throws:
EolRuntimeException
-
executeBody
protected java.lang.Object executeBody(IEolContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
evaluatePreConditions
protected void evaluatePreConditions(IEolContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
checkResultType
protected void checkResultType(java.lang.Object result, IEolContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
evaluatePostConditions
protected void evaluatePostConditions(IEolContext context, java.lang.Object result) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getReturnType
public EolType getReturnType(IEolContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getContextType
public EolType getContextType(IEolContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getName
public java.lang.String getName()
-
getFormalParameters
public java.util.List<Parameter> getFormalParameters()
-
getBody
public StatementBlock getBody()
-
setBody
public void setBody(StatementBlock body)
-
getNameExpression
public NameExpression getNameExpression()
-
setNameExpression
public void setNameExpression(NameExpression nameExpression)
-
getContextTypeExpression
public TypeExpression getContextTypeExpression()
-
setContextTypeExpression
public void setContextTypeExpression(TypeExpression contextTypeExpression)
-
getReturnTypeExpression
public TypeExpression getReturnTypeExpression()
-
setReturnTypeExpression
public void setReturnTypeExpression(TypeExpression returnTypeExpression)
-
-