Package com.thoughtworks.qdox.model
Class Type
- java.lang.Object
-
- com.thoughtworks.qdox.model.Type
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
- Direct Known Subclasses:
TypeVariable
,WildcardType
public class Type extends java.lang.Object implements java.lang.Comparable, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Type[]
EMPTY_ARRAY
static Type
VOID
-
Constructor Summary
Constructors Constructor Description Type(java.lang.String fullName)
Type(java.lang.String fullName, int dimensions)
Type(java.lang.String fullName, int dimensions, JavaClassParent context)
Type(java.lang.String fullName, TypeDef typeDef, int dimensions, JavaClassParent context)
Type(java.lang.String fullName, java.lang.String name, int dimensions, JavaClassParent context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
static Type
createUnresolved(TypeDef typeDef, int dimensions, JavaClassParent context)
static Type
createUnresolved(TypeDef typeDef, JavaClassParent context)
static Type
createUnresolved(java.lang.String name, int dimensions, JavaClassParent context)
boolean
equals(java.lang.Object obj)
Type[]
getActualTypeArguments()
int
getDimensions()
Returns the depth of this array, 0 if it's not an arrayjava.lang.String
getFullQualifiedName()
Deprecated.instead use getFullyQualifiedName()java.lang.String
getFullyQualifiedName()
Returns the FQN of an Object or the handler of a Type If the name of the can't be resolved based on the imports and the classes on the classpath the name will be returned InnerClasses will use the $ sign Some examples how names will be translatedjava.lang.String
getGenericValue()
The FQN representation of an Object for code usage This implementation ignores generics Some examples how Objects will be translatedprotected java.lang.String
getGenericValue(TypeVariable[] typeVariableList)
JavaClass
getJavaClass()
JavaClassParent
getJavaClassParent()
protected java.lang.String
getResolvedGenericValue(TypeVariable[] typeParameters)
protected java.lang.String
getResolvedValue(TypeVariable[] typeParameters)
protected int
getTypeVariableIndex(JavaClass superClass)
java.lang.String
getValue()
The FQN representation of an Object for code usage This implementation ignores generics Some examples how Objects will be translatedint
hashCode()
boolean
isA(Type type)
boolean
isArray()
Returns true if this Type is an arrayboolean
isPrimitive()
boolean
isResolved()
Checks if the FQN of this Type is resolvedboolean
isVoid()
protected Type
resolve(JavaClass parentClass)
protected Type
resolve(JavaClass parentClass, JavaClass subclass)
java.lang.String
toGenericString()
Returns getGenericValue() extended with the array informationjava.lang.String
toString()
Returns getValue() extended with the array information
-
-
-
Constructor Detail
-
Type
public Type(java.lang.String fullName, java.lang.String name, int dimensions, JavaClassParent context)
-
Type
public Type(java.lang.String fullName, TypeDef typeDef, int dimensions, JavaClassParent context)
-
Type
public Type(java.lang.String fullName, int dimensions, JavaClassParent context)
-
Type
public Type(java.lang.String fullName, int dimensions)
-
Type
public Type(java.lang.String fullName)
-
-
Method Detail
-
createUnresolved
public static Type createUnresolved(java.lang.String name, int dimensions, JavaClassParent context)
-
createUnresolved
public static Type createUnresolved(TypeDef typeDef, int dimensions, JavaClassParent context)
-
createUnresolved
public static Type createUnresolved(TypeDef typeDef, JavaClassParent context)
-
getJavaClassParent
public JavaClassParent getJavaClassParent()
-
getFullQualifiedName
public java.lang.String getFullQualifiedName()
Deprecated.instead use getFullyQualifiedName()
-
getFullyQualifiedName
public java.lang.String getFullyQualifiedName()
Returns the FQN of an Object or the handler of a Type If the name of the can't be resolved based on the imports and the classes on the classpath the name will be returned InnerClasses will use the $ sign Some examples how names will be translatedObject > java.lang.Object java.util.List > java.util.List ? > ? T > T anypackage.Outer.Inner > anypackage.Outer$Inner
- Returns:
-
getValue
public java.lang.String getValue()
The FQN representation of an Object for code usage This implementation ignores generics Some examples how Objects will be translatedObject > java.lang.object java.util.List
> java.util.List ? > ? T > T anypackage.Outer.Inner > anypackage.Outer.Inner - Returns:
- type representation for code usage
-
getGenericValue
public java.lang.String getGenericValue()
The FQN representation of an Object for code usage This implementation ignores generics Some examples how Objects will be translatedObject > java.lang.object java.util.List
> java.util.List ? > ? T > T anypackage.Outer.Inner > anypackage.Outer.Inner - Returns:
- generic type representation for code usage
- Since:
- 1.8
-
getGenericValue
protected java.lang.String getGenericValue(TypeVariable[] typeVariableList)
-
getResolvedValue
protected java.lang.String getResolvedValue(TypeVariable[] typeParameters)
-
getResolvedGenericValue
protected java.lang.String getResolvedGenericValue(TypeVariable[] typeParameters)
-
isResolved
public boolean isResolved()
Checks if the FQN of this Type is resolved- Returns:
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable
- See Also:
Comparable.compareTo(Object)
-
isArray
public boolean isArray()
Returns true if this Type is an array- Returns:
-
getDimensions
public int getDimensions()
Returns the depth of this array, 0 if it's not an array- Returns:
- The depth of this array
-
getActualTypeArguments
public Type[] getActualTypeArguments()
- Returns:
- the actualTypeArguments or null
-
toString
public java.lang.String toString()
Returns getValue() extended with the array information- Overrides:
toString
in classjava.lang.Object
- Returns:
-
toGenericString
public java.lang.String toGenericString()
Returns getGenericValue() extended with the array informationObject > java.lang.Object Object[] > java.lang.Object[] List
- Returns:
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getJavaClass
public JavaClass getJavaClass()
-
isA
public boolean isA(Type type)
- Since:
- 1.3
-
isPrimitive
public boolean isPrimitive()
- Since:
- 1.6
-
isVoid
public boolean isVoid()
- Since:
- 1.6
-
getTypeVariableIndex
protected int getTypeVariableIndex(JavaClass superClass)
- Parameters:
superClass
-- Returns:
- Since:
- 1.12
-
resolve
protected Type resolve(JavaClass parentClass)
- Parameters:
parentClass
-- Returns:
- Since:
- 1.12
-
-