public abstract class AbstractDescriptor extends Object implements TypeDescriptor
Constructor and Description |
---|
AbstractDescriptor(ElementId elementId) |
Modifier and Type | Method and Description |
---|---|
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 unboxedValue)
Append a conversion to an Ecore value.
|
Boolean |
appendEcoreStatements(JavaStream js,
JavaLocalContext<?> localContext,
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.
|
EClassifier |
getEClassifier()
Return the Ecore EClassifier described by this type.
|
ElementId |
getElementId() |
TypeDescriptor |
getPrimitiveDescriptor()
Return the type descriptor for use when a primitive type would be appropriate.
|
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.
|
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
append, getClassName, getEcoreDescriptor, getJavaClass, getUnboxedDescriptor, hasJavaClass, isAssignableFrom
public AbstractDescriptor(ElementId elementId)
public Boolean appendBox(JavaStream js, JavaLocalContext<?> localContext, CGBoxExp cgBoxExp, CGValuedElement unboxedValue)
TypeDescriptor
appendBox
in interface TypeDescriptor
public void appendCast(JavaStream js, Class<?> actualJavaClass, JavaStream.SubStream subStream)
TypeDescriptor
appendCast
in interface TypeDescriptor
public void appendCastTerm(JavaStream js, CGValuedElement cgElement)
TypeDescriptor
appendCastTerm
in interface TypeDescriptor
public Boolean appendEcore(JavaStream js, JavaLocalContext<?> localContext, CGEcoreExp cgEcoreExp, CGValuedElement unboxedValue)
TypeDescriptor
appendEcore
in interface TypeDescriptor
public void appendEcoreValue(JavaStream js, String requiredClassName, CGValuedElement cgValue)
TypeDescriptor
appendEcoreValue
in interface TypeDescriptor
public void appendNotEqualsTerm(JavaStream js, CGValuedElement thisValue, TypeDescriptor thatTypeDescriptor, String thatName)
TypeDescriptor
appendNotEqualsTerm
in interface TypeDescriptor
public Boolean appendEcoreStatements(JavaStream js, JavaLocalContext<?> localContext, CGEcoreExp cgEcoreExp, CGValuedElement boxedValue)
TypeDescriptor
appendEcoreStatements
in interface TypeDescriptor
public void appendEqualsValue(JavaStream js, CGValuedElement thisValue, CGValuedElement thatValue, boolean notEquals)
TypeDescriptor
appendEqualsValue
in interface TypeDescriptor
public Boolean appendUnboxStatements(JavaStream js, JavaLocalContext<?> localContext, CGUnboxExp cgUnboxExp, CGValuedElement boxedValue)
TypeDescriptor
appendUnboxStatements
in interface TypeDescriptor
public CollectionDescriptor asCollectionDescriptor()
TypeDescriptor
asCollectionDescriptor
in interface TypeDescriptor
public EClassifier getEClassifier()
TypeDescriptor
getEClassifier
in interface TypeDescriptor
public ElementId getElementId()
public TypeDescriptor getPrimitiveDescriptor()
TypeDescriptor
getPrimitiveDescriptor
in interface TypeDescriptor
public boolean isAssignableTo(Class<?> javaClass)
TypeDescriptor
isAssignableTo
in interface TypeDescriptor
public boolean isPrimitive()
TypeDescriptor
isPrimitive
in interface TypeDescriptor
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.