public interface TypeDescriptor
Derived classes support boxed/unboxed types, static/dynamic Ecore and collections.
Modifier and Type | Method and Description |
---|---|
void |
append(JavaStream js,
Boolean isRequired)
Append the declaration of this type to a JavaStream.
|
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,
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
|
Boolean |
appendEcore(JavaStream js,
JavaLocalContext<?> localContext,
CGEcoreExp cgEcoreExp,
CGValuedElement ecoreValue)
Append a conversion to an Ecore value.
|
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,
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,
String thatName)
Append an expression term that evaluates whether (this TypedDescriptor and) thisValue is not equal to thatTypeDescriptor and thatName.
|
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.
|
String |
getClassName()
Return the fully qualified Java class name described by this type.
|
EClassifier |
getEClassifier()
Return the Ecore EClassifier described by this type.
|
EcoreDescriptor |
getEcoreDescriptor(CodeGenerator codeGenerator,
Class<?> instanceClass)
Return the type descriptor for use when an Ecore type would be appropriate.
|
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.
|
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(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(JavaStream js, Boolean isRequired)
Boolean appendBox(JavaStream js, JavaLocalContext<?> localContext, CGBoxExp cgBoxExp, CGValuedElement unboxedValue)
void appendCast(JavaStream js, Class<?> actualJavaClass, JavaStream.SubStream subStream)
Boolean appendEcore(JavaStream js, JavaLocalContext<?> localContext, CGEcoreExp cgEcoreExp, CGValuedElement ecoreValue)
void appendCastTerm(JavaStream js, CGValuedElement cgElement)
Boolean appendEcoreStatements(JavaStream js, JavaLocalContext<?> localContext2, CGEcoreExp cgEcoreExp, CGValuedElement boxedValue)
void appendEcoreValue(JavaStream js, String requiredClassName, CGValuedElement cgValue)
void appendNotEqualsTerm(JavaStream js, CGValuedElement thisValue, TypeDescriptor thatTypeDescriptor, String thatName)
void appendEqualsValue(JavaStream js, CGValuedElement thisValue, CGValuedElement thatValue, boolean notEquals)
Boolean appendUnboxStatements(JavaStream js, JavaLocalContext<?> localContext, CGUnboxExp cgUnboxExp, CGValuedElement boxedValue)
CollectionDescriptor asCollectionDescriptor()
String getClassName()
EClassifier getEClassifier()
EcoreDescriptor getEcoreDescriptor(CodeGenerator codeGenerator, Class<?> instanceClass)
Class<?> getJavaClass()
TypeDescriptor getPrimitiveDescriptor()
UnboxedDescriptor getUnboxedDescriptor(CodeGenerator codeGenerator)
Class<?> hasJavaClass()
boolean isAssignableFrom(TypeDescriptor typeDescriptor)
boolean isAssignableTo(Class<?> javaClass)
boolean isPrimitive()
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.