|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.codegen.generator.AbstractCodeGenerator
org.eclipse.ocl.examples.codegen.java.JavaCodeGenerator
public abstract class JavaCodeGenerator
OCL2JavaClass supports generation of the content of a JavaClassFile to provide the polymorphic implementation of an ExpressionInOCL.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.eclipse.ocl.examples.codegen.generator.AbstractCodeGenerator |
|---|
genModelHelper, metaModelManager, nameManager, ORG_ECLIPSE_JDT_ANNOTATION_NON_NULL, ORG_ECLIPSE_JDT_ANNOTATION_NULLABLE |
| Constructor Summary | |
|---|---|
JavaCodeGenerator(MetaModelManager metaModelManager)
|
|
| Method Summary | |
|---|---|
BoxingAnalyzer |
createBoxingAnalyzer()
|
CG2JavaPreVisitor |
createCG2JavaPreVisitor()
|
CommonSubexpressionEliminator |
createCommonSubexpressionEliminator()
|
DependencyVisitor |
createDependencyVisitor()
|
FieldingAnalyzer |
createFieldingAnalyzer()
|
protected GenModelHelper |
createGenModelHelper()
|
protected JavaGlobalContext |
createGlobalContext()
|
protected Id2BoxedDescriptorVisitor |
createId2BoxedDescriptorVisitor()
|
protected Id2EClassVisitor |
createId2EClassVisitor()
|
protected NameManager |
createNameManager()
|
ReferencesVisitor |
createReferencesVisitor()
|
BoxedDescriptor |
getBoxedDescriptor(ElementId elementId)
|
CGModelResourceFactory |
getCGResourceFactory()
|
java.lang.String |
getConstantsClass()
|
JavaGlobalContext |
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)
|
TypeDescriptor |
getTypeDescriptor(ElementId elementId,
boolean isBoxed)
Deprecated. |
TypeDescriptor |
getTypeDescriptor(ElementId elementId,
boolean isBoxed,
boolean maybePrimitive)
Deprecated. |
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. |
| Methods inherited from class org.eclipse.ocl.examples.codegen.generator.AbstractCodeGenerator |
|---|
addProblem, createAnalysisVisitor, createOptions, getDefaultIndent, getGenModelHelper, getMetaModelManager, getNameManager, getOptions, isFinal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.ocl.examples.codegen.generator.CodeGenerator |
|---|
getAnalyzer |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public JavaCodeGenerator(@NonNull
MetaModelManager metaModelManager)
| Method Detail |
|---|
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 JavaGlobalContext createGlobalContext()
@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 JavaGlobalContext getGlobalContext()
@NonNull public GlobalPlace getGlobalPlace()
@NonNull public Id2BoxedDescriptorVisitor getId2BoxedDescriptorVisitor()
@NonNull public Id2EClassVisitor getId2EClassVisitor()
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)
@Deprecated
@NonNull
public TypeDescriptor getTypeDescriptor(@NonNull
ElementId elementId,
boolean isBoxed)
@Deprecated
@NonNull
public TypeDescriptor getTypeDescriptor(@NonNull
ElementId elementId,
boolean isBoxed,
boolean maybePrimitive)
@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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||