public class EnumClassBuilder extends RecoderModelTransformer
EnumDeclaration
into a corresponding EnumClassDeclaration
.RecoderModelTransformer.FinalOuterVarsCollector, RecoderModelTransformer.TransformerCache
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Map<FieldReference,UncollatedReferenceQualifier> |
caseSubstitutes
a mapping of constant references in switch-statements and their
substitutes.
|
(package private) java.util.Map<EnumDeclaration,EnumClassDeclaration> |
substitutes
a mapping of enums to the newly created class declarations.
|
cache, services
EQUIVALENCE, IDENTITY, NO_PROBLEM
Constructor and Description |
---|
EnumClassBuilder(CrossReferenceServiceConfiguration services,
RecoderModelTransformer.TransformerCache cache)
create a new instance that uses the given service configuration and works
on the given list of compilation units
|
Modifier and Type | Method and Description |
---|---|
private void |
addCases(EnumDeclaration ed)
find enumconstants in case statements and mark them for substitution.
|
ProblemReport |
analyze()
find all enum declarations and make their substitutes.
|
protected void |
makeExplicit(TypeDeclaration td)
Deprecated.
THIS DOES NOT WORK ANY MORE, SINCE THE CACHE ONLY CONSIDERS CLASSE TYPES, NOT ENUMS!
|
void |
transform()
substitute all case statements that have been recorded earlier.
|
assign, attach, attribute, classDeclarations, containingClass, containingMethod, declare, declare, getAllSupertypes, getDefaultValue, getId, getLocalClass2FinalVar, getUnits, isVisible, makeExplicit
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
java.util.Map<EnumDeclaration,EnumClassDeclaration> substitutes
java.util.Map<FieldReference,UncollatedReferenceQualifier> caseSubstitutes
public EnumClassBuilder(CrossReferenceServiceConfiguration services, RecoderModelTransformer.TransformerCache cache)
services
- the cross referencing service configuration to be usedcache
- 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 ProblemReport analyze()
analyze
in class TwoPassTransformation
TwoPassTransformation.analyze()
private void addCases(EnumDeclaration ed)
ed
- the EnumDeclaration to search for.protected void makeExplicit(TypeDeclaration td)
makeExplicit
in class RecoderModelTransformer
RecoderModelTransformer.makeExplicit(recoder.java.declaration.TypeDeclaration)
public void transform()
transform
in class RecoderModelTransformer
RecoderModelTransformer.transform()