Package org.eclipse.epsilon.etl.dom
Class TransformationRule
- java.lang.Object
-
- org.eclipse.epsilon.common.module.AbstractModuleElement
-
- org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
-
- org.eclipse.epsilon.erl.dom.NamedRule
-
- org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
-
- org.eclipse.epsilon.etl.dom.TransformationRule
-
- All Implemented Interfaces:
ModuleElement
public class TransformationRule extends ExtensibleNamedRule
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutableBlock<java.lang.Void>bodyprotected IEtlContextcontextprotected ExecutableBlock<java.lang.Boolean>guardprotected java.lang.BooleanisPrimaryprotected java.util.Collection<java.lang.Object>rejectedprotected ParametersourceParameterprotected java.util.List<Parameter>targetParametersprotected java.util.Set<java.lang.Object>transformedElements-
Fields inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
allSuperRules, isAbstract, isGreedy, isLazy, ofKindCache, ofTypeCache, superRules, superRulesIdentifiers
-
Fields inherited from class org.eclipse.epsilon.erl.dom.NamedRule
nameExpression
-
Fields inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
annotationBlock
-
-
Constructor Summary
Constructors Constructor Description TransformationRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappliesTo(java.lang.Object source, IEtlContext context, boolean asSuperRule)booleanappliesTo(java.lang.Object source, IEtlContext context, boolean asSuperRule, boolean checkTypes)voidbuild(AST cst, IModule module)booleancanTransformExcluded(IEtlContext context)voiddispose()protected voidexecuteSuperRulesAndBody(java.lang.Object source, java.util.Collection<java.lang.Object> targets_, IEtlContext context)java.util.Collection<?>getAllInstances(IEtlContext context)ExecutableBlock<java.lang.Void>getBody()ExecutableBlock<java.lang.Boolean>getGuard()ParametergetSourceParameter()ASTgetSuperRulesAst(AST cst)java.util.List<Parameter>getTargetParameters()booleanhasTransformed(java.lang.Object source)booleanisLazy(IEolContext context)booleanisPrimary(IEtlContext context)voidsetBody(ExecutableBlock<java.lang.Void> body)voidsetGuard(ExecutableBlock<java.lang.Boolean> guard)voidsetSourceParameter(Parameter sourceParameter)booleanshouldBeTransformed(java.lang.Object instance, java.util.Collection<java.lang.Object> excluded, IEtlContext context, boolean overrideLazy)java.lang.StringtoString()java.util.Collection<?>transform(java.lang.Object source, java.util.Collection<java.lang.Object> targets, IEtlContext context)java.util.Collection<?>transform(java.lang.Object source, IEtlContext context)voidtransformAll(IEtlContext context, java.util.Collection<java.lang.Object> excluded, boolean includeLazy)-
Methods inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
calculateSuperRules, calculateSuperRules, getAllInstances, getAllOfKind, getAllOfType, getAllSuperRules, getRuleByName, getSuperRules, isAbstract, isGreedy
-
Methods inherited from class org.eclipse.epsilon.erl.dom.NamedRule
equals, getName, getNameAst, getNameExpression, hashCode, setNameExpression
-
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
getChildren, getComments, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
sourceParameter
protected Parameter sourceParameter
-
targetParameters
protected java.util.List<Parameter> targetParameters
-
guard
protected ExecutableBlock<java.lang.Boolean> guard
-
body
protected ExecutableBlock<java.lang.Void> body
-
context
protected IEtlContext context
-
isPrimary
protected java.lang.Boolean isPrimary
-
rejected
protected java.util.Collection<java.lang.Object> rejected
-
transformedElements
protected java.util.Set<java.lang.Object> transformedElements
-
-
Method Detail
-
getSuperRulesAst
public AST getSuperRulesAst(AST cst)
- Specified by:
getSuperRulesAstin classExtensibleNamedRule
-
getSourceParameter
public Parameter getSourceParameter()
-
setSourceParameter
public void setSourceParameter(Parameter sourceParameter)
-
getBody
public ExecutableBlock<java.lang.Void> getBody()
-
setBody
public void setBody(ExecutableBlock<java.lang.Void> body)
-
getGuard
public ExecutableBlock<java.lang.Boolean> getGuard()
-
setGuard
public void setGuard(ExecutableBlock<java.lang.Boolean> guard)
-
getTargetParameters
public java.util.List<Parameter> getTargetParameters()
-
build
public void build(AST cst, IModule module)
- Specified by:
buildin interfaceModuleElement- Overrides:
buildin classExtensibleNamedRule
-
isLazy
public boolean isLazy(IEolContext context) throws EolRuntimeException
- Overrides:
isLazyin classExtensibleNamedRule- Throws:
EolRuntimeException
-
hasTransformed
public boolean hasTransformed(java.lang.Object source)
-
appliesTo
public boolean appliesTo(java.lang.Object source, IEtlContext context, boolean asSuperRule) throws EolRuntimeException- Throws:
EolRuntimeException
-
appliesTo
public boolean appliesTo(java.lang.Object source, IEtlContext context, boolean asSuperRule, boolean checkTypes) throws EolRuntimeException- Throws:
EolRuntimeException
-
getAllInstances
public java.util.Collection<?> getAllInstances(IEtlContext context) throws EolRuntimeException
- Parameters:
context-- Returns:
- Throws:
EolRuntimeException- Since:
- 1.6
-
transformAll
public void transformAll(IEtlContext context, java.util.Collection<java.lang.Object> excluded, boolean includeLazy) throws EolRuntimeException
- Parameters:
context-excluded-includeLazy- Whether to transform lazy rules.- Throws:
EolRuntimeException- Since:
- 1.6
-
transform
public java.util.Collection<?> transform(java.lang.Object source, java.util.Collection<java.lang.Object> targets, IEtlContext context) throws EolRuntimeException- Throws:
EolRuntimeException
-
transform
public java.util.Collection<?> transform(java.lang.Object source, IEtlContext context) throws EolRuntimeException- Throws:
EolRuntimeException
-
executeSuperRulesAndBody
protected void executeSuperRulesAndBody(java.lang.Object source, java.util.Collection<java.lang.Object> targets_, IEtlContext context) throws EolRuntimeException- Throws:
EolRuntimeException
-
isPrimary
public boolean isPrimary(IEtlContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
canTransformExcluded
public boolean canTransformExcluded(IEtlContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
shouldBeTransformed
public boolean shouldBeTransformed(java.lang.Object instance, java.util.Collection<java.lang.Object> excluded, IEtlContext context, boolean overrideLazy) throws EolRuntimeException- Throws:
EolRuntimeException
-
dispose
public void dispose()
-
-