org.eclipse.ocl.examples.codegen.java.types
Class EObjectsDescriptor
java.lang.Object
org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
org.eclipse.ocl.examples.codegen.java.types.AbstractCollectionDescriptor
org.eclipse.ocl.examples.codegen.java.types.EObjectsDescriptor
- All Implemented Interfaces:
- TypeDescriptor, CollectionDescriptor, UnboxedDescriptor
public class EObjectsDescriptor
- extends AbstractCollectionDescriptor
- implements UnboxedDescriptor
An EObjectsDescriptor describes a type for a collection of (unboxed) EObject representations. It has a pivot CollectionTypeId describing
both collection and elements, a Java class name for the elements and an EClassifier for the elements.
Note that in EMF, that Java class for all collections is java.util.List.
This descriptor is used whenever the Java classes actually exist.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
eClassifier
@NonNull
protected final org.eclipse.emf.ecore.EClassifier eClassifier
javaClass
@NonNull
protected final java.lang.Class<?> javaClass
oldJavaClass
@NonNull
protected final java.lang.Class<?> oldJavaClass
EObjectsDescriptor
public EObjectsDescriptor(@NonNull
CollectionTypeId collectionTypeId,
@NonNull
org.eclipse.emf.ecore.EClassifier eClassifier,
@NonNull
java.lang.Class<?> javaClass)
append
public void append(@NonNull
JavaStream javaStream)
- Description copied from interface:
TypeDescriptor
- Append the declaration of this type to a JavaStream. e.g. "typename"
- Specified by:
append
in interface TypeDescriptor
append
public void append(@NonNull
JavaStream javaStream,
boolean reClass)
- Specified by:
append
in interface CollectionDescriptor
- Overrides:
append
in class AbstractCollectionDescriptor
appendElement
public void appendElement(@NonNull
JavaStream javaStream,
boolean reClass)
- Specified by:
appendElement
in interface CollectionDescriptor
- Overrides:
appendElement
in class AbstractCollectionDescriptor
getClassName
@NonNull
public java.lang.String getClassName()
- Description copied from interface:
TypeDescriptor
- Return the fully qualified Java class name described by this type. In the case of collection types, this method returns
the class name of the collection elements.
- Specified by:
getClassName
in interface TypeDescriptor
getJavaClass
@NonNull
public java.lang.Class<?> getJavaClass()
- Description copied from interface:
TypeDescriptor
- Return the basic Java class for this descriptor. e.g. List> for an unboxed collection.
- Specified by:
getJavaClass
in interface TypeDescriptor
getUnboxedDescriptor
@NonNull
public UnboxedDescriptor getUnboxedDescriptor()
- Description copied from interface:
TypeDescriptor
- Return the type descriptor for use when an unboxed type would be appropriate.
Returns this when this is an unboxed descriptor.
- Specified by:
getUnboxedDescriptor
in interface TypeDescriptor
hasJavaClass
@Nullable
public java.lang.Class<?> hasJavaClass()
- Description copied from interface:
TypeDescriptor
- Return the basic Java class for this descriptor. e.g. List> for an unboxed collection.
Returns null for no Java class known.
- Specified by:
hasJavaClass
in interface TypeDescriptor
isAssignableFrom
public final boolean isAssignableFrom(@NonNull
TypeDescriptor typeDescriptor)
- Description copied from interface:
TypeDescriptor
- Return true if an instance described by typeDescriptor may be assigned to an instance described by this.
- Specified by:
isAssignableFrom
in interface TypeDescriptor