public interface TypeDescriptor
Derived classes support boxed/unboxed types, static/dynamic Ecore and collections.
Modifier and Type | Method and Description |
---|---|
void |
append(JavaStream js,
java.lang.Boolean isRequired)
Append the declaration of this type to a JavaStream.
|
java.lang.Boolean |
appendBox(JavaStream js,
JavaLocalContext<?> localContext,
CGBoxExp cgBoxExp,
CGValuedElement unboxedValue)
Append the appropriate statements to js to create the boxed value for cgBboxExp from its unboxedValue.
|
void |
appendCast(JavaStream js,
java.lang.Class<?> actualJavaClass,
JavaStream.SubStream subStream)
Append the actualJavaClass subStream to js wrapped in a cast to this type.g.
|
void |
appendCastTerm(JavaStream js,
CGValuedElement cgElement)
Append a cgElement to js wrapped in a cast to this type
|
java.lang.Boolean |
appendEcore(JavaStream js,
JavaLocalContext<?> localContext,
CGEcoreExp cgEcoreExp,
CGValuedElement ecoreValue)
Append a conversion to an Ecore value.
|
java.lang.Boolean |
appendEcoreStatements(JavaStream js,
JavaLocalContext<?> localContext2,
CGEcoreExp cgEcoreExp,
CGValuedElement boxedValue)
Append the appropriate statements to js to create the ecore value for cgEcoreExp from its boxedValue.
|
void |
appendEcoreValue(JavaStream js,
java.lang.String requiredClassName,
CGValuedElement cgValue)
Append cgValue to js casting an internally typed Ecore value to requiredClassName.
|
void |
appendEqualsValue(JavaStream js,
CGValuedElement thisValue,
CGValuedElement thatValue,
boolean notEquals)
Append an expression term that evaluates whether (this TypedDescriptor and) thisValue is not equals/ notEquals to thatValue.
|
void |
appendNotEqualsTerm(JavaStream js,
CGValuedElement thisValue,
TypeDescriptor thatTypeDescriptor,
java.lang.String thatName)
Append an expression term that evaluates whether (this TypedDescriptor and) thisValue is not equal to thatTypeDescriptor and thatName.
|
java.lang.Boolean |
appendUnboxStatements(JavaStream js,
JavaLocalContext<?> localContext,
CGUnboxExp cgUnboxExp,
CGValuedElement boxedValue)
Append the appropriate statements to js to create the unboxed value for cgUnboxExp from its boxedValue.
|
CollectionDescriptor |
asCollectionDescriptor()
Return a non-null Collection type descriptor if this type descriptor describes a Collection.
|
java.lang.String |
getClassName()
Return the fully qualified Java class name described by this type.
|
org.eclipse.emf.ecore.EClassifier |
getEClassifier()
Return the Ecore EClassifier described by this type.
|
EcoreDescriptor |
getEcoreDescriptor(CodeGenerator codeGenerator,
java.lang.Class<?> instanceClass)
Return the type descriptor for use when an Ecore type would be appropriate.
|
java.lang.Class<?> |
getJavaClass()
Return the basic Java class for this descriptor.
|
TypeDescriptor |
getPrimitiveDescriptor()
Return the type descriptor for use when a primitive type would be appropriate.
|
UnboxedDescriptor |
getUnboxedDescriptor(CodeGenerator codeGenerator)
Return the type descriptor for use when an unboxed type would be appropriate.
|
java.lang.Class<?> |
hasJavaClass()
Return the basic Java class for this descriptor.
|
boolean |
isAssignableFrom(TypeDescriptor typeDescriptor)
Return true if an instance described by typeDescriptor may be assigned to an instance described by this.
|
boolean |
isAssignableTo(java.lang.Class<?> javaClass)
Return true if an instance described by this typeDescriptor may be assigned to a javaClass.
|
boolean |
isPrimitive()
Return true is this is a built-in primitive type such as boolean or int.
|
void append(@NonNull JavaStream js, @Nullable java.lang.Boolean isRequired)
@NonNull java.lang.Boolean appendBox(@NonNull JavaStream js, @NonNull JavaLocalContext<?> localContext, @NonNull CGBoxExp cgBoxExp, @NonNull CGValuedElement unboxedValue)
void appendCast(@NonNull JavaStream js, @Nullable java.lang.Class<?> actualJavaClass, @Nullable JavaStream.SubStream subStream)
@NonNull java.lang.Boolean appendEcore(@NonNull JavaStream js, @NonNull JavaLocalContext<?> localContext, @NonNull CGEcoreExp cgEcoreExp, @NonNull CGValuedElement ecoreValue)
void appendCastTerm(@NonNull JavaStream js, @NonNull CGValuedElement cgElement)
@NonNull java.lang.Boolean appendEcoreStatements(@NonNull JavaStream js, @NonNull JavaLocalContext<?> localContext2, @NonNull CGEcoreExp cgEcoreExp, @NonNull CGValuedElement boxedValue)
void appendEcoreValue(@NonNull JavaStream js, @NonNull java.lang.String requiredClassName, @NonNull CGValuedElement cgValue)
void appendNotEqualsTerm(@NonNull JavaStream js, @NonNull CGValuedElement thisValue, @NonNull TypeDescriptor thatTypeDescriptor, @NonNull java.lang.String thatName)
void appendEqualsValue(@NonNull JavaStream js, @NonNull CGValuedElement thisValue, @NonNull CGValuedElement thatValue, boolean notEquals)
@NonNull java.lang.Boolean appendUnboxStatements(@NonNull JavaStream js, @NonNull JavaLocalContext<?> localContext, @NonNull CGUnboxExp cgUnboxExp, @NonNull CGValuedElement boxedValue)
@Nullable CollectionDescriptor asCollectionDescriptor()
@NonNull java.lang.String getClassName()
@Nullable org.eclipse.emf.ecore.EClassifier getEClassifier()
@NonNull EcoreDescriptor getEcoreDescriptor(@NonNull CodeGenerator codeGenerator, @Nullable java.lang.Class<?> instanceClass)
@NonNull java.lang.Class<?> getJavaClass()
@NonNull TypeDescriptor getPrimitiveDescriptor()
@NonNull UnboxedDescriptor getUnboxedDescriptor(@NonNull CodeGenerator codeGenerator)
@Nullable java.lang.Class<?> hasJavaClass()
boolean isAssignableFrom(@NonNull TypeDescriptor typeDescriptor)
boolean isAssignableTo(@NonNull java.lang.Class<?> javaClass)
boolean isPrimitive()