public abstract class JavaCodeGenerator extends AbstractCodeGenerator
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.lang.Class<?>,java.lang.Class<?>> |
javaPrimitiveClasses |
static java.util.Map<java.lang.String,java.lang.Class<?>> |
javaPrimitiveNames |
static java.lang.Class<?>[] |
knownClasses
The known classes that templates may use in unqualified form.
|
environmentFactory, genModelHelper, metamodelManager, nameManager, ORG_ECLIPSE_JDT_ANNOTATION_NON_NULL, ORG_ECLIPSE_JDT_ANNOTATION_NULLABLE
Constructor and Description |
---|
JavaCodeGenerator(EnvironmentFactoryInternal environmentFactory) |
Modifier and Type | Method and Description |
---|---|
BoxingAnalyzer |
createBoxingAnalyzer() |
CG2JavaPreVisitor |
createCG2JavaPreVisitor() |
CommonSubexpressionEliminator |
createCommonSubexpressionEliminator() |
DependencyVisitor |
createDependencyVisitor() |
FieldingAnalyzer |
createFieldingAnalyzer() |
protected GenModelHelper |
createGenModelHelper() |
protected Id2BoxedDescriptorVisitor |
createId2BoxedDescriptorVisitor() |
protected Id2EClassVisitor |
createId2EClassVisitor() |
protected NameManager |
createNameManager() |
ReferencesVisitor |
createReferencesVisitor() |
BoxedDescriptor |
getBoxedDescriptor(ElementId elementId) |
CGModelResourceFactory |
getCGResourceFactory() |
java.lang.String |
getConstantsClass() |
EcoreDescriptor |
getEcoreDescriptor(ElementId elementId,
java.lang.Class<?> instanceClass) |
abstract JavaGlobalContext<? extends JavaCodeGenerator> |
getGlobalContext() |
GlobalPlace |
getGlobalPlace() |
Id2BoxedDescriptorVisitor |
getId2BoxedDescriptorVisitor() |
Id2EClassVisitor |
getId2EClassVisitor() |
java.lang.Boolean |
getIsNonNull(java.lang.reflect.Method method)
Return true for an @NonNull annotation, false for an @Nullable annotation, null otherwise.
|
Iteration2Java |
getIterationHelper(Iteration asIteration) |
java.lang.reflect.Method |
getLeastDerivedMethod(java.lang.Class<?> requiredClass,
java.lang.String getAccessor) |
TypeDescriptor |
getTypeDescriptor(CGValuedElement cgElement) |
UnboxedDescriptor |
getUnboxedDescriptor(ElementId elementId) |
static void |
initPrimitive(java.lang.Class<?> class1,
java.lang.Class<?> class2) |
java.lang.Boolean |
isNonNull(OperationCallExp asOperationCallExp)
Return true if asOperationCallExp may return a nonNull value,
false if asOperationCallExp may return a null value,
null if no determination can be made.
|
java.lang.Boolean |
isNonNull(Property asProperty)
Return true if asProperty may provide a nonNull value,
false if asOperationCallExp may provide a null value,
null if no determination can be made.
|
boolean |
maybePrimitive(CGValuedElement cgValue)
Return true if cgValue could be represented by a primitive value.
|
protected void |
optimize(CGPackage cgPackage)
Perform the overall optimization of the CG tree.
|
java.util.List<CGValuedElement> |
prepareGlobals()
After overall optimization, return a sorted list of global declarations.
|
addProblem, createAnalysisVisitor, createOptions, getDefaultIndent, getEnvironmentFactory, getGenModelHelper, getNameManager, getOptions, isFinal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnalyzer
public static java.util.Map<java.lang.Class<?>,java.lang.Class<?>> javaPrimitiveClasses
public static java.util.Map<java.lang.String,java.lang.Class<?>> javaPrimitiveNames
@NonNull public static final java.lang.Class<?>[] knownClasses
public JavaCodeGenerator(@NonNull EnvironmentFactoryInternal environmentFactory)
public static void initPrimitive(java.lang.Class<?> class1, java.lang.Class<?> class2)
@NonNull public BoxingAnalyzer createBoxingAnalyzer()
@NonNull public CommonSubexpressionEliminator createCommonSubexpressionEliminator()
@NonNull public CG2JavaPreVisitor createCG2JavaPreVisitor()
@NonNull public DependencyVisitor createDependencyVisitor()
@NonNull public FieldingAnalyzer createFieldingAnalyzer()
@NonNull protected GenModelHelper createGenModelHelper()
createGenModelHelper
in class AbstractCodeGenerator
@NonNull protected Id2EClassVisitor createId2EClassVisitor()
@NonNull protected Id2BoxedDescriptorVisitor createId2BoxedDescriptorVisitor()
@NonNull protected NameManager createNameManager()
createNameManager
in class AbstractCodeGenerator
@NonNull public ReferencesVisitor createReferencesVisitor()
@NonNull public BoxedDescriptor getBoxedDescriptor(@NonNull ElementId elementId)
@NonNull public CGModelResourceFactory getCGResourceFactory()
@Nullable public java.lang.String getConstantsClass()
@NonNull public EcoreDescriptor getEcoreDescriptor(@NonNull ElementId elementId, @Nullable java.lang.Class<?> instanceClass)
@NonNull public abstract JavaGlobalContext<? extends JavaCodeGenerator> getGlobalContext()
@NonNull public GlobalPlace getGlobalPlace()
@NonNull public Id2BoxedDescriptorVisitor getId2BoxedDescriptorVisitor()
@NonNull public Id2EClassVisitor getId2EClassVisitor()
@Nullable public java.lang.Boolean getIsNonNull(@NonNull java.lang.reflect.Method method)
@Nullable public Iteration2Java getIterationHelper(@NonNull Iteration asIteration)
@Nullable public java.lang.reflect.Method getLeastDerivedMethod(@NonNull java.lang.Class<?> requiredClass, @NonNull java.lang.String getAccessor)
@NonNull public TypeDescriptor getTypeDescriptor(@NonNull CGValuedElement cgElement)
@NonNull public UnboxedDescriptor getUnboxedDescriptor(@NonNull ElementId elementId)
@Nullable public java.lang.Boolean isNonNull(@NonNull OperationCallExp asOperationCallExp)
CodeGenerator
@Nullable public java.lang.Boolean isNonNull(@NonNull Property asProperty)
CodeGenerator
public boolean maybePrimitive(@NonNull CGValuedElement cgValue)
CodeGenerator
protected void optimize(@NonNull CGPackage cgPackage)
@Nullable public java.util.List<CGValuedElement> prepareGlobals()