public abstract class RecoderModelTransformer extends TwoPassTransformation
Modifier and Type | Class and Description |
---|---|
protected class |
RecoderModelTransformer.FinalOuterVarsCollector |
static class |
RecoderModelTransformer.TransformerCache
Cache of important data.
|
private static class |
RecoderModelTransformer.TypeAndClassDeclarationCollector |
Modifier and Type | Field and Description |
---|---|
protected RecoderModelTransformer.TransformerCache |
cache |
protected CrossReferenceServiceConfiguration |
services |
EQUIVALENCE, IDENTITY, NO_PROBLEM
Constructor and Description |
---|
RecoderModelTransformer(CrossReferenceServiceConfiguration services,
RecoderModelTransformer.TransformerCache cache)
creates a transormder for the recoder model
|
Modifier and Type | Method and Description |
---|---|
protected CopyAssignment |
assign(Expression lhs,
Expression rhs) |
void |
attach(MethodDeclaration md,
TypeDeclaration td,
int idx)
attaches a method declaration to the declaration of type td at
position idx
|
protected FieldReference |
attribute(ReferencePrefix prefix,
Identifier attributeName) |
protected java.util.Set<ClassDeclaration> |
classDeclarations() |
protected ClassDeclaration |
containingClass(TypeDeclaration td) |
protected MethodDeclaration |
containingMethod(TypeDeclaration td) |
protected LocalVariableDeclaration |
declare(java.lang.String name,
ClassType type) |
protected LocalVariableDeclaration |
declare(java.lang.String name,
Identifier type) |
protected java.util.List<ClassType> |
getAllSupertypes(TypeDeclaration td) |
Expression |
getDefaultValue(Type type)
returns the default value of the given type
according to JLS Sect. 4.5.5
|
protected Identifier |
getId(TypeDeclaration td) |
java.util.HashMap<ClassType,java.util.List<Variable>> |
getLocalClass2FinalVar() |
java.util.List<CompilationUnit> |
getUnits() |
boolean |
isVisible()
returns if changes have to be reported to the change history
|
void |
makeExplicit()
invokes model transformation for each top level type declaration
in any compilation unit.
|
protected abstract void |
makeExplicit(TypeDeclaration td)
The method is called for each type declaration of the compilation
unit and initiates the syntactical transformation.
|
void |
transform()
Starts the transformation.
|
analyze, execute
attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsBody, attachAsCondition, attachAsGuard, attachAsInitializer, attachAsLabel, attachAsMessage, attachAsPrefix, attachAsPrefix, attachAsPrefix, attachAsPrefix, attachAsUpdate, detach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsBody, doAttachAsCondition, doAttachAsGuard, doAttachAsInitializer, doAttachAsLabel, doAttachAsMessage, doAttachAsPrefix, doAttachAsPrefix, doAttachAsPrefix, doAttachAsPrefix, doAttachAsUpdate, doDetach, doReplace, getChangeHistory, getCrossReferenceSourceInfo, getNameInfo, getProblemReport, getProgramFactory, getServiceConfiguration, getSourceFileRepository, getSourceInfo, replace, rollback, setProblemReport, setServiceConfiguration, toString
protected CrossReferenceServiceConfiguration services
protected RecoderModelTransformer.TransformerCache cache
public RecoderModelTransformer(CrossReferenceServiceConfiguration services, RecoderModelTransformer.TransformerCache cache)
services
- the CrossReferenceServiceConfiguration to access
model informationcache
- a cache object that stores information which is needed by
and common to many transformations. it includes the compilation units,
the declared classes, and information for local classes.public Expression getDefaultValue(Type type)
public void attach(MethodDeclaration md, TypeDeclaration td, int idx)
md
- the MethodDeclaration to inserttd
- the TypeDeclaration that becomes parent of the new
methodidx
- the position where to add the methodpublic boolean isVisible()
isVisible
in class Transformation
protected abstract void makeExplicit(TypeDeclaration td)
protected FieldReference attribute(ReferencePrefix prefix, Identifier attributeName)
protected CopyAssignment assign(Expression lhs, Expression rhs)
protected LocalVariableDeclaration declare(java.lang.String name, ClassType type)
protected LocalVariableDeclaration declare(java.lang.String name, Identifier type)
protected Identifier getId(TypeDeclaration td)
protected ClassDeclaration containingClass(TypeDeclaration td)
protected MethodDeclaration containingMethod(TypeDeclaration td)
public void makeExplicit()
protected java.util.List<ClassType> getAllSupertypes(TypeDeclaration td)
protected java.util.Set<ClassDeclaration> classDeclarations()
public java.util.HashMap<ClassType,java.util.List<Variable>> getLocalClass2FinalVar()
public java.util.List<CompilationUnit> getUnits()
public void transform()
transform
in class TwoPassTransformation