org.eclipse.ocl.examples.codegen.java.types
Class UnboxedElementsDescriptor

java.lang.Object
  extended by org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
      extended by org.eclipse.ocl.examples.codegen.java.types.AbstractCollectionDescriptor
          extended by org.eclipse.ocl.examples.codegen.java.types.UnboxedElementsDescriptor
All Implemented Interfaces:
TypeDescriptor, CollectionDescriptor, UnboxedDescriptor

public class UnboxedElementsDescriptor
extends AbstractCollectionDescriptor
implements UnboxedDescriptor

A UnboxedElementsDescriptor describes a collection type for which no Java class may eveer exist. It has a pivot CollectionTypeId, and a stamdardLibrary and the pivot type.

Theis descriptor is used in JUnit tests for expressions and when the genModel is unknown.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
AbstractDescriptor.NamedFuture
 
Field Summary
protected  DomainStandardLibrary standardLibrary
           
protected  Type type
           
 
Fields inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
elementId
 
Constructor Summary
UnboxedElementsDescriptor(CollectionTypeId collectionTypeId, DomainStandardLibrary standardLibrary, Type type)
           
 
Method Summary
 void append(JavaStream javaStream)
          Append the declaration of this type to a JavaStream.
 void appendElement(JavaStream javaStream, boolean reClass)
           
 java.lang.String getClassName()
          Return the fully qualified Java class name described by this type.
 java.lang.Class<?> getJavaClass()
          Return the basic Java class for this descriptor.
 UnboxedDescriptor getUnboxedDescriptor()
          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.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractCollectionDescriptor
append, appendBox, asCollectionDescriptor, getElementId, isAssignableTo
 
Methods inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
appendCast, appendCastTerm, appendEqualsValue, appendNotEqualsTerm, appendUnboxStatements, getEClassifier, getPrimitiveDescriptor, reClass, zzisBoxedType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.codegen.generator.TypeDescriptor
appendBox, appendCast, appendCastTerm, appendEqualsValue, appendNotEqualsTerm, appendUnboxStatements, asCollectionDescriptor, getEClassifier, getPrimitiveDescriptor, isAssignableTo
 

Field Detail

standardLibrary

@NonNull
protected final DomainStandardLibrary standardLibrary

type

@NonNull
protected final Type type
Constructor Detail

UnboxedElementsDescriptor

public UnboxedElementsDescriptor(@NonNull
                                 CollectionTypeId collectionTypeId,
                                 @NonNull
                                 DomainStandardLibrary standardLibrary,
                                 @NonNull
                                 Type type)
Method Detail

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

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

toString

@NonNull
public java.lang.String toString()
Overrides:
toString in class AbstractCollectionDescriptor