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<Void>
body
protected IEtlContext
context
protected ExecutableBlock<Boolean>
guard
protected Boolean
isPrimary
protected Collection<Object>
rejected
protected Parameter
sourceParameter
protected List<Parameter>
targetParameters
protected Set<Object>
transformedElements
-
Fields inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
allSuperRules, isAbstract, isGreedy, isLazy, isParallel, 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
-
Methods inherited from class org.eclipse.epsilon.erl.dom.ExtensibleNamedRule
calculateSuperRules, calculateSuperRules, getAllInstances, getAllOfKind, getAllOfType, getAllSuperRules, getRuleByName, getSuperRules, isAbstract, isGreedy, isParallel
-
Methods inherited from class org.eclipse.epsilon.erl.dom.NamedRule
equals, getName, getNameAst, getNameExpression, hashCode
-
Methods inherited from class org.eclipse.epsilon.eol.dom.AnnotatableModuleElement
accept, getAnnotation, getAnnotationBlock, getAnnotations, getAnnotationsValues, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, getBooleanAnnotationValue, hasAnnotation, setAnnotationBlock
-
Methods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
getChildren, getComments, getData, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
sourceParameter
protected Parameter sourceParameter
-
guard
protected ExecutableBlock<Boolean> guard
-
body
protected ExecutableBlock<Void> body
-
context
protected IEtlContext context
-
isPrimary
protected Boolean isPrimary
-
rejected
protected Collection<Object> rejected
-
-
Method Detail
-
getSuperRulesAst
public AST getSuperRulesAst(AST cst)
- Specified by:
getSuperRulesAst
in classExtensibleNamedRule
-
getSourceParameter
public Parameter getSourceParameter()
-
setSourceParameter
public void setSourceParameter(Parameter sourceParameter)
-
getBody
public ExecutableBlock<Void> getBody()
-
setBody
public void setBody(ExecutableBlock<Void> body)
-
getGuard
public ExecutableBlock<Boolean> getGuard()
-
setGuard
public void setGuard(ExecutableBlock<Boolean> guard)
-
build
public void build(AST cst, IModule module)
- Specified by:
build
in interfaceModuleElement
- Overrides:
build
in classExtensibleNamedRule
-
isLazy
public boolean isLazy(IEolContext context) throws EolRuntimeException
- Overrides:
isLazy
in classExtensibleNamedRule
- Throws:
EolRuntimeException
-
hasTransformed
public boolean hasTransformed(Object source)
-
appliesTo
public boolean appliesTo(Object source, IEtlContext context, boolean asSuperRule) throws EolRuntimeException
- Throws:
EolRuntimeException
-
appliesTo
public boolean appliesTo(Object source, IEtlContext context, boolean asSuperRule, boolean checkTypes) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getAllInstances
public Collection<?> getAllInstances(IEtlContext context) throws EolRuntimeException
- Parameters:
context
-- Returns:
- Throws:
EolRuntimeException
- Since:
- 1.6
-
transformAll
public void transformAll(IEtlContext context, Collection<Object> excluded, boolean includeLazy) throws EolRuntimeException
- Parameters:
context
-excluded
-includeLazy
- Whether to transform lazy rules.- Throws:
EolRuntimeException
- Since:
- 1.6
-
transform
public Collection<?> transform(Object source, Collection<Object> targets, IEtlContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
transform
public Collection<?> transform(Object source, IEtlContext context) throws EolRuntimeException
- Throws:
EolRuntimeException
-
executeSuperRulesAndBody
protected void executeSuperRulesAndBody(Object source, Collection<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(Object instance, Collection<Object> excluded, IEtlContext context, boolean overrideLazy) throws EolRuntimeException
- Throws:
EolRuntimeException
-
accept
public void accept(IEtlVisitor visitor)
-
dispose
public void dispose()
-
-