Class Type

java.lang.Object
com.thoughtworks.qdox.model.Type
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
TypeVariable, WildcardType

public class Type extends Object implements Comparable, Serializable
See Also:
  • Field Details

    • EMPTY_ARRAY

      public static final Type[] EMPTY_ARRAY
    • VOID

      public static final Type VOID
  • Constructor Details

  • Method Details

    • createUnresolved

      public static Type createUnresolved(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 String getFullQualifiedName()
      Deprecated.
      instead use getFullyQualifiedName()
    • getFullyQualifiedName

      public 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 translated
       Object > java.lang.Object
       java.util.List > java.util.List
       ?  > ?
       T  > T
       anypackage.Outer.Inner > anypackage.Outer$Inner
       
      Returns:
    • getValue

      public String getValue()
      The FQN representation of an Object for code usage This implementation ignores generics Some examples how Objects will be translated
       Object > 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 String getGenericValue()
      The FQN representation of an Object for code usage This implementation ignores generics Some examples how Objects will be translated
       Object > 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 String getGenericValue(TypeVariable[] typeVariableList)
    • getResolvedValue

      protected String getResolvedValue(TypeVariable[] typeParameters)
    • getResolvedGenericValue

      protected String getResolvedGenericValue(TypeVariable[] typeParameters)
    • isResolved

      public boolean isResolved()
      Checks if the FQN of this Type is resolved
      Returns:
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable
      See Also:
    • 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 String toString()
      Returns getValue() extended with the array information
      Overrides:
      toString in class Object
      Returns:
    • toGenericString

      public String toGenericString()
      Returns getGenericValue() extended with the array information
       Object > java.lang.Object
       Object[] > java.lang.Object[]
       List > java.lang.Listinvalid input: '<'java.lang.Object>
       Outer.Inner > Outer.Inner 
       Outer.Inner[][] > Outer.Innerinvalid input: '<'java.lang.Object>[][] 
       
      
      Returns:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class 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
    • resolve

      protected Type resolve(JavaClass parentClass, JavaClass subclass)
      Parameters:
      parentClass -
      subclass -
      Returns:
      Since:
      1.12