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>
body
protected IEtlContext
context
protected ExecutableBlock<java.lang.Boolean>
guard
protected java.lang.Boolean
isPrimary
protected java.util.Collection<java.lang.Object>
rejected
protected Parameter
sourceParameter
protected java.util.List<Parameter>
targetParameters
protected 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 boolean
appliesTo(java.lang.Object source, IEtlContext context, boolean asSuperRule)
boolean
appliesTo(java.lang.Object source, IEtlContext context, boolean asSuperRule, boolean checkTypes)
void
build(AST cst, IModule module)
boolean
canTransformExcluded(IEtlContext context)
void
dispose()
protected void
executeSuperRulesAndBody(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()
Parameter
getSourceParameter()
AST
getSuperRulesAst(AST cst)
java.util.List<Parameter>
getTargetParameters()
boolean
hasTransformed(java.lang.Object source)
boolean
isLazy(IEolContext context)
boolean
isPrimary(IEtlContext context)
void
setBody(ExecutableBlock<java.lang.Void> body)
void
setGuard(ExecutableBlock<java.lang.Boolean> guard)
void
setSourceParameter(Parameter sourceParameter)
boolean
shouldBeTransformed(java.lang.Object instance, java.util.Collection<java.lang.Object> excluded, IEtlContext context, boolean overrideLazy)
java.lang.String
toString()
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)
void
transformAll(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:
getSuperRulesAst
in 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:
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(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()
-
-