Class ModifyableJavaType

  • All Implemented Interfaces:
    com.thoughtworks.qdox.model.JavaAnnotatedElement, com.thoughtworks.qdox.model.JavaClass, com.thoughtworks.qdox.model.JavaGenericDeclaration, com.thoughtworks.qdox.model.JavaModel, com.thoughtworks.qdox.model.JavaType, Serializable
    Direct Known Subclasses:
    ModifyableJavaTypeVariable

    public class ModifyableJavaType
    extends Object
    implements com.thoughtworks.qdox.model.JavaClass, com.thoughtworks.qdox.model.JavaType, Serializable
    The default implementation for JavaType
    Since:
    2.0
    Author:
    Robert Scholte
    See Also:
    Serialized Form
    • Field Detail

      • name

        protected final String name
      • fullName

        protected String fullName
    • Method Detail

      • getBinaryName

        public String getBinaryName()
        Specified by:
        getBinaryName in interface com.thoughtworks.qdox.model.JavaType
      • getSimpleName

        public String getSimpleName()
        Specified by:
        getSimpleName in interface com.thoughtworks.qdox.model.JavaClass
      • getFullyQualifiedName

        public String getFullyQualifiedName()
        Specified by:
        getFullyQualifiedName in interface com.thoughtworks.qdox.model.JavaType
      • getComponentType

        public com.thoughtworks.qdox.model.JavaClass getComponentType()
        Specified by:
        getComponentType in interface com.thoughtworks.qdox.model.JavaClass
      • getValue

        public String getValue()
        Specified by:
        getValue in interface com.thoughtworks.qdox.model.JavaType
      • getGenericValue

        public String getGenericValue()
        Specified by:
        getGenericValue in interface com.thoughtworks.qdox.model.JavaType
      • getGenericValue

        protected static <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> String getGenericValue​(com.thoughtworks.qdox.model.JavaType base,
                                                                                                               List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> typeVariableList)
      • getResolvedValue

        protected static <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> String getResolvedValue​(com.thoughtworks.qdox.model.JavaType base,
                                                                                                                List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> typeParameters)
      • resolve

        protected static <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> com.thoughtworks.qdox.model.JavaTypeVariable<D> resolve​(com.thoughtworks.qdox.model.JavaType base,
                                                                                                                                                List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> typeParameters)
      • isResolved

        protected boolean isResolved()
      • isArray

        public boolean isArray()
        Specified by:
        isArray in interface com.thoughtworks.qdox.model.JavaClass
      • getDimensions

        public int getDimensions()
        Specified by:
        getDimensions in interface com.thoughtworks.qdox.model.JavaClass
      • toString

        public String toString()
        Equivalent of Class.toString(). Converts the object to a string.
        Specified by:
        toString in interface com.thoughtworks.qdox.model.JavaClass
        Overrides:
        toString in class Object
        Returns:
        a string representation of this type.
        See Also:
        Class.toString()
      • toGenericString

        public String toGenericString()
        Returns getGenericValue() extended with the array information
         Object > java.lang.Object
         Object[] > java.lang.Object[]
         List<Object> > java.lang.List<java.lang.Object>
         Outer.Inner > Outer$Inner
         Outer.Inner<Object>[][] > Outer$Inner<java.lang.Object>[][]
         
        Specified by:
        toGenericString in interface com.thoughtworks.qdox.model.JavaType
        Returns:
        a generic string representation of this type.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isA

        public boolean isA​(com.thoughtworks.qdox.model.JavaType type)
        Parameters:
        type - the type to match with
        Returns:
        true if this type if of type, otherwise false
        Since:
        1.3
      • isPrimitive

        public boolean isPrimitive()
        Specified by:
        isPrimitive in interface com.thoughtworks.qdox.model.JavaClass
      • isVoid

        public boolean isVoid()
        Specified by:
        isVoid in interface com.thoughtworks.qdox.model.JavaClass
      • resolve

        protected static com.thoughtworks.qdox.model.JavaType resolve​(com.thoughtworks.qdox.model.JavaType base,
                                                                      com.thoughtworks.qdox.model.JavaClass declaringClass,
                                                                      com.thoughtworks.qdox.model.JavaClass callingClass)
        Consider the following example
         public abstract class AbstractClass<T> {
             private T value;
        
             public AbstractClass(T value) {
                 this.value = value;
             }
        
             public T getValue() {
                 return value;
             }
         }
        
         public class ConcreteClass extends AbstractClass<String> {
             public ConcreteClass(String s) {
                 super(s);
             }
         }
         

        We want to know the resolved returnType when calling ConcreteClass.getValue(). The expected type is String.

        • this would be T
        • declaringClass would be AbstractClass, since that's where T is used
        • callingClass would be ConcreteClass
        Parameters:
        base - the base
        declaringClass - the declaring class
        callingClass - the calling class
        Returns:
        the resolved type
      • getGenericFullyQualifiedName

        public String getGenericFullyQualifiedName()
        Specified by:
        getGenericFullyQualifiedName in interface com.thoughtworks.qdox.model.JavaType
      • getGenericCanonicalName

        public String getGenericCanonicalName()
        Specified by:
        getGenericCanonicalName in interface com.thoughtworks.qdox.model.JavaType
      • getResolvedGenericValue

        protected static <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> String getResolvedGenericValue​(com.thoughtworks.qdox.model.JavaType base,
                                                                                                                       List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> typeParameters)
      • getResolvedGenericFullyQualifiedName

        protected static <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> String getResolvedGenericFullyQualifiedName​(com.thoughtworks.qdox.model.JavaType base,
                                                                                                                                    List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> typeParameters)
      • getResolvedFullyQualifiedName

        protected static <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> String getResolvedFullyQualifiedName​(com.thoughtworks.qdox.model.JavaType base,
                                                                                                                             List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> typeParameters)
      • getSource

        public com.thoughtworks.qdox.model.JavaSource getSource()
        Specified by:
        getSource in interface com.thoughtworks.qdox.model.JavaClass
      • getLineNumber

        public int getLineNumber()
        Specified by:
        getLineNumber in interface com.thoughtworks.qdox.model.JavaModel
      • isInterface

        public boolean isInterface()
        Specified by:
        isInterface in interface com.thoughtworks.qdox.model.JavaClass
      • getAnnotations

        public List<com.thoughtworks.qdox.model.JavaAnnotation> getAnnotations()
        Specified by:
        getAnnotations in interface com.thoughtworks.qdox.model.JavaAnnotatedElement
      • isEnum

        public boolean isEnum()
        Specified by:
        isEnum in interface com.thoughtworks.qdox.model.JavaClass
      • getComment

        public String getComment()
        Specified by:
        getComment in interface com.thoughtworks.qdox.model.JavaAnnotatedElement
      • getTags

        public List<com.thoughtworks.qdox.model.DocletTag> getTags()
        Specified by:
        getTags in interface com.thoughtworks.qdox.model.JavaAnnotatedElement
      • isAnnotation

        public boolean isAnnotation()
        Specified by:
        isAnnotation in interface com.thoughtworks.qdox.model.JavaClass
      • getTagsByName

        public List<com.thoughtworks.qdox.model.DocletTag> getTagsByName​(String name)
        Specified by:
        getTagsByName in interface com.thoughtworks.qdox.model.JavaAnnotatedElement
      • getTagByName

        public com.thoughtworks.qdox.model.DocletTag getTagByName​(String name)
        Specified by:
        getTagByName in interface com.thoughtworks.qdox.model.JavaAnnotatedElement
      • getSuperClass

        public com.thoughtworks.qdox.model.JavaType getSuperClass()
        Specified by:
        getSuperClass in interface com.thoughtworks.qdox.model.JavaClass
      • getSuperJavaClass

        public com.thoughtworks.qdox.model.JavaClass getSuperJavaClass()
        Specified by:
        getSuperJavaClass in interface com.thoughtworks.qdox.model.JavaClass
      • getImplements

        public List<com.thoughtworks.qdox.model.JavaType> getImplements()
        Specified by:
        getImplements in interface com.thoughtworks.qdox.model.JavaClass
      • getInterfaces

        public List<com.thoughtworks.qdox.model.JavaClass> getInterfaces()
        Specified by:
        getInterfaces in interface com.thoughtworks.qdox.model.JavaClass
      • getNamedParameter

        public String getNamedParameter​(String tagName,
                                        String parameterName)
        Specified by:
        getNamedParameter in interface com.thoughtworks.qdox.model.JavaAnnotatedElement
      • getCodeBlock

        public String getCodeBlock()
        Specified by:
        getCodeBlock in interface com.thoughtworks.qdox.model.JavaClass
        Specified by:
        getCodeBlock in interface com.thoughtworks.qdox.model.JavaModel
      • getTypeParameters

        public <D extends com.thoughtworks.qdox.model.JavaGenericDeclaration> List<com.thoughtworks.qdox.model.JavaTypeVariable<D>> getTypeParameters()
        Specified by:
        getTypeParameters in interface com.thoughtworks.qdox.model.JavaGenericDeclaration
      • getParentSource

        public com.thoughtworks.qdox.model.JavaSource getParentSource()
        Specified by:
        getParentSource in interface com.thoughtworks.qdox.model.JavaClass
      • getPackage

        public com.thoughtworks.qdox.model.JavaPackage getPackage()
        Specified by:
        getPackage in interface com.thoughtworks.qdox.model.JavaClass
      • getPackageName

        public String getPackageName()
        Specified by:
        getPackageName in interface com.thoughtworks.qdox.model.JavaClass
      • isInner

        public boolean isInner()
        Specified by:
        isInner in interface com.thoughtworks.qdox.model.JavaClass
      • getInitializers

        public List<com.thoughtworks.qdox.model.JavaInitializer> getInitializers()
        Specified by:
        getInitializers in interface com.thoughtworks.qdox.model.JavaClass
      • getMethods

        public List<com.thoughtworks.qdox.model.JavaMethod> getMethods()
        Specified by:
        getMethods in interface com.thoughtworks.qdox.model.JavaClass
      • getConstructors

        public List<com.thoughtworks.qdox.model.JavaConstructor> getConstructors()
        Specified by:
        getConstructors in interface com.thoughtworks.qdox.model.JavaClass
      • getConstructor

        public com.thoughtworks.qdox.model.JavaConstructor getConstructor​(List<com.thoughtworks.qdox.model.JavaType> parameterTypes)
        Specified by:
        getConstructor in interface com.thoughtworks.qdox.model.JavaClass
      • getConstructor

        public com.thoughtworks.qdox.model.JavaConstructor getConstructor​(List<com.thoughtworks.qdox.model.JavaType> parameterTypes,
                                                                          boolean varArg)
        Specified by:
        getConstructor in interface com.thoughtworks.qdox.model.JavaClass
      • getMethods

        public List<com.thoughtworks.qdox.model.JavaMethod> getMethods​(boolean superclasses)
        Specified by:
        getMethods in interface com.thoughtworks.qdox.model.JavaClass
      • getMethodBySignature

        public com.thoughtworks.qdox.model.JavaMethod getMethodBySignature​(String name,
                                                                           List<com.thoughtworks.qdox.model.JavaType> parameterTypes)
        Specified by:
        getMethodBySignature in interface com.thoughtworks.qdox.model.JavaClass
      • getMethod

        public com.thoughtworks.qdox.model.JavaMethod getMethod​(String name,
                                                                List<com.thoughtworks.qdox.model.JavaType> parameterTypes,
                                                                boolean varArgs)
        Specified by:
        getMethod in interface com.thoughtworks.qdox.model.JavaClass
      • getMethodBySignature

        public com.thoughtworks.qdox.model.JavaMethod getMethodBySignature​(String name,
                                                                           List<com.thoughtworks.qdox.model.JavaType> parameterTypes,
                                                                           boolean superclasses)
        Specified by:
        getMethodBySignature in interface com.thoughtworks.qdox.model.JavaClass
      • getMethodBySignature

        public com.thoughtworks.qdox.model.JavaMethod getMethodBySignature​(String name,
                                                                           List<com.thoughtworks.qdox.model.JavaType> parameterTypes,
                                                                           boolean superclasses,
                                                                           boolean varArg)
        Specified by:
        getMethodBySignature in interface com.thoughtworks.qdox.model.JavaClass
      • getMethodsBySignature

        public List<com.thoughtworks.qdox.model.JavaMethod> getMethodsBySignature​(String name,
                                                                                  List<com.thoughtworks.qdox.model.JavaType> parameterTypes,
                                                                                  boolean superclasses)
        Specified by:
        getMethodsBySignature in interface com.thoughtworks.qdox.model.JavaClass
      • getMethodsBySignature

        public List<com.thoughtworks.qdox.model.JavaMethod> getMethodsBySignature​(String name,
                                                                                  List<com.thoughtworks.qdox.model.JavaType> parameterTypes,
                                                                                  boolean superclasses,
                                                                                  boolean varArg)
        Specified by:
        getMethodsBySignature in interface com.thoughtworks.qdox.model.JavaClass
      • getFields

        public List<com.thoughtworks.qdox.model.JavaField> getFields()
        Specified by:
        getFields in interface com.thoughtworks.qdox.model.JavaClass
      • getFieldByName

        public com.thoughtworks.qdox.model.JavaField getFieldByName​(String name)
        Specified by:
        getFieldByName in interface com.thoughtworks.qdox.model.JavaClass
      • getEnumConstants

        public List<com.thoughtworks.qdox.model.JavaField> getEnumConstants()
        Specified by:
        getEnumConstants in interface com.thoughtworks.qdox.model.JavaClass
      • getEnumConstantByName

        public com.thoughtworks.qdox.model.JavaField getEnumConstantByName​(String name)
        Specified by:
        getEnumConstantByName in interface com.thoughtworks.qdox.model.JavaClass
      • getNestedClasses

        public List<com.thoughtworks.qdox.model.JavaClass> getNestedClasses()
        Specified by:
        getNestedClasses in interface com.thoughtworks.qdox.model.JavaClass
      • getNestedClassByName

        public com.thoughtworks.qdox.model.JavaClass getNestedClassByName​(String name)
        Specified by:
        getNestedClassByName in interface com.thoughtworks.qdox.model.JavaClass
      • isA

        public boolean isA​(String fullClassName)
        Specified by:
        isA in interface com.thoughtworks.qdox.model.JavaClass
      • isA

        public boolean isA​(com.thoughtworks.qdox.model.JavaClass javaClass)
        Specified by:
        isA in interface com.thoughtworks.qdox.model.JavaClass
      • getBeanProperties

        public List<com.thoughtworks.qdox.model.BeanProperty> getBeanProperties()
        Specified by:
        getBeanProperties in interface com.thoughtworks.qdox.model.JavaClass
      • getBeanProperties

        public List<com.thoughtworks.qdox.model.BeanProperty> getBeanProperties​(boolean superclasses)
        Specified by:
        getBeanProperties in interface com.thoughtworks.qdox.model.JavaClass
      • getBeanProperty

        public com.thoughtworks.qdox.model.BeanProperty getBeanProperty​(String propertyName)
        Specified by:
        getBeanProperty in interface com.thoughtworks.qdox.model.JavaClass
      • getBeanProperty

        public com.thoughtworks.qdox.model.BeanProperty getBeanProperty​(String propertyName,
                                                                        boolean superclasses)
        Specified by:
        getBeanProperty in interface com.thoughtworks.qdox.model.JavaClass
      • getDerivedClasses

        public List<com.thoughtworks.qdox.model.JavaClass> getDerivedClasses()
        Specified by:
        getDerivedClasses in interface com.thoughtworks.qdox.model.JavaClass
      • getTagsByName

        public List<com.thoughtworks.qdox.model.DocletTag> getTagsByName​(String name,
                                                                         boolean superclasses)
        Specified by:
        getTagsByName in interface com.thoughtworks.qdox.model.JavaClass
      • getJavaClassLibrary

        public com.thoughtworks.qdox.library.ClassLibrary getJavaClassLibrary()
        Specified by:
        getJavaClassLibrary in interface com.thoughtworks.qdox.model.JavaClass
      • getName

        public String getName()
        Specified by:
        getName in interface com.thoughtworks.qdox.model.JavaClass
      • getCanonicalName

        public String getCanonicalName()
        Specified by:
        getCanonicalName in interface com.thoughtworks.qdox.model.JavaType
      • getModifiers

        public List<String> getModifiers()
        Specified by:
        getModifiers in interface com.thoughtworks.qdox.model.JavaClass
      • isPublic

        public boolean isPublic()
        Specified by:
        isPublic in interface com.thoughtworks.qdox.model.JavaClass
      • isProtected

        public boolean isProtected()
        Specified by:
        isProtected in interface com.thoughtworks.qdox.model.JavaClass
      • isPrivate

        public boolean isPrivate()
        Specified by:
        isPrivate in interface com.thoughtworks.qdox.model.JavaClass
      • isFinal

        public boolean isFinal()
        Specified by:
        isFinal in interface com.thoughtworks.qdox.model.JavaClass
      • isStatic

        public boolean isStatic()
        Specified by:
        isStatic in interface com.thoughtworks.qdox.model.JavaClass
      • isAbstract

        public boolean isAbstract()
        Specified by:
        isAbstract in interface com.thoughtworks.qdox.model.JavaClass
      • getDeclaringClass

        public com.thoughtworks.qdox.model.JavaClass getDeclaringClass()
        Specified by:
        getDeclaringClass in interface com.thoughtworks.qdox.model.JavaClass