|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.umlv.tatoo.cc.common.generator.Type
public class Type
Represents a Java Type.
Field Summary | |
---|---|
static Type |
BOOLEAN
The boolean Type. |
static Type |
BYTE
The byte Type. |
static Type |
CHARACTER
The char Type. |
static Type |
DOUBLE
The double Type. |
static Type |
FLOAT
The float Type. |
static Type |
INT
The int Type. |
static Type |
LONG
The long Type. |
static Type |
SHORT
The short Type. |
static Type |
VOID
The void Type. |
Method Summary | |
---|---|
void |
addImportsTo(Set<Type> imports)
Add all types used by the current type to the import set. |
Type |
boxIfPrimitive()
Returns the current type or its wrapper type
if the the current type is a primitive. |
int |
compareTo(Type type)
This implementation compares to type using their names. |
static Type |
createArrayType(Type type)
Creates an array type from a type. |
static Type |
createParametrizedType(Type type,
List<Type> typeArguments)
Creates a parameterized type. |
static Type |
createParametrizedType(Type type,
Type... typeArguments)
Creates a parameterized type. |
static Type |
createQualifiedType(String qualifiedName)
Creates a Type from a qualified string. |
static Type |
createType(String typeName,
Map<String,? extends Type> imports)
Creates a type from a name with optional type arguments and a map of imports. |
boolean |
equals(Object o)
|
Type |
getComponentType()
Returns the component type of the current type if the current type is an array. |
String |
getDefaultValue()
Returns the default value of the current type. |
String |
getName()
Returns the fully qualified name of the current type. |
String |
getPackageName()
Return the qualified part of the current type. |
String |
getRawName()
Returns the qualified name of the current type without its type arguments. |
Type |
getRawType()
Returns a qualified type corresponding to the current type without its type arguments. |
String |
getSimpleName()
Returns the unqualified name of the current type. |
String |
getSimpleRawName()
Returns the unqualified name of the current type without its type arguments. |
List<Type> |
getTypeArguments()
Returns a read/write list of type arguments of the current type or an empty list if the current type is not a parameterized type. |
String |
getVMTypeName()
Return the name used by the VM in case of erasure. |
Type |
getWrapperType()
Returns the wrapper type of the current type if the current type is a primitive type. |
int |
hashCode()
|
boolean |
hasTypeArguments()
Returns true if the current type is a parameterized type with type arguments. |
boolean |
isArray()
Returns true if the current type is an array. |
boolean |
isObjectType()
Returns true if the current type is an object type. |
boolean |
isPrimitive()
Returns true is the current type is a primitive type. |
boolean |
isQualifiedType()
Returns true if the current type is qualified. |
boolean |
isVoid()
Returns true if the current type is VOID . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Type BOOLEAN
public static final Type BYTE
public static final Type SHORT
public static final Type CHARACTER
public static final Type INT
public static final Type LONG
public static final Type FLOAT
public static final Type DOUBLE
public static final Type VOID
Method Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public int compareTo(Type type)
compareTo
in interface Comparable<Type>
getName()
public String toString()
toString
in class Object
public boolean isPrimitive()
VOID
is not a primitive type.
isObjectType()
,
isVoid()
public boolean isObjectType()
VOID
is an object type.
isPrimitive()
,
isVoid()
public boolean isQualifiedType()
public boolean isArray()
getComponentType()
public boolean isVoid()
VOID
.
VOID
.isPrimitive()
,
isObjectType()
public String getName()
java.util.List<E>
.
getSimpleName()
,
getSimpleRawName()
,
getPackageName()
public Type getComponentType()
isArray()
public Type getWrapperType()
boxIfPrimitive()
public Type boxIfPrimitive()
wrapper type
if the the current type is a primitive.
wrapper type
if the the current type is a primitive.getWrapperType()
public String getDefaultValue()
public String getRawName()
IllegalStateException
- if the current type is an array.getRawType()
,
getName()
,
getSimpleRawName()
public Type getRawType()
IllegalStateException
- if the current type is an array.addImportsTo(Set)
,
getRawName()
public String getSimpleRawName()
IllegalStateException
- if the current type is an array.getRawType()
,
getName()
,
getRawName()
public String getSimpleName()
List<E>
.
getName()
,
getSimpleRawName()
,
getPackageName()
public String getPackageName()
IllegalStateException
- if the current type is an array
or an unqualified type.getName()
,
getSimpleName()
public String getVMTypeName()
getRawName()
,
isPrimitive()
public boolean hasTypeArguments()
getTypeArguments()
public List<Type> getTypeArguments()
public void addImportsTo(Set<Type> imports)
getRawType()
public static Type createQualifiedType(String qualifiedName)
qualifiedName
- the qualified name of the type
IllegalArgumentException
- if the name taken as argument
is not qualified.createType(String, Map)
public static Type createParametrizedType(Type type, Type... typeArguments)
type
- the generic type.typeArguments
- the type arguments.
createType(String, Map)
,
createParametrizedType(Type, List)
public static Type createParametrizedType(Type type, List<Type> typeArguments)
type
- the generic type.typeArguments
- the type arguments.
createType(String, Map)
,
createParametrizedType(Type, Type...)
public static Type createArrayType(Type type)
type
- the component type.
getComponentType()
public static Type createType(String typeName, Map<String,? extends Type> imports)
typeName
- a name with optional type argumentsimports
- a map of imports (unqualified name to qualified name)
createParametrizedType(Type, Type...)
,
createQualifiedType(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |