JavaClass
Date: 2017-03-29

com.thoughtworks.qdox.model

## Class JavaClass

- java.lang.Object
- - com.thoughtworks.qdox.model.AbstractBaseJavaEntity
  - - com.thoughtworks.qdox.model.AbstractJavaEntity
    - - com.thoughtworks.qdox.model.AbstractInheritableJavaEntity
      - - com.thoughtworks.qdox.model.JavaClass

- All Implemented Interfaces:
    JavaClassParent, java.io.Serializable, java.lang.Comparable

      public class JavaClass
      extends AbstractInheritableJavaEntity
      implements JavaClassParent

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.thoughtworks.qdox.model.AbstractJavaEntity

      `modifiers`

    - ### Fields inherited from class com.thoughtworks.qdox.model.AbstractBaseJavaEntity

      `name, parent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaClass()`
    `JavaClass(java.lang.String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClass(JavaClass cls)`
    `void` | `addField(JavaField javaField)`
    `void` | `addMethod(JavaMethod meth)`
    `Type` | `asType()`
    `int` | `compareTo(java.lang.Object o)`
    `BeanProperty[]` | `getBeanProperties()` Gets bean properties without looking in superclasses or interfaces.
    `BeanProperty[]` | `getBeanProperties(boolean superclasses)`
    `BeanProperty` | `getBeanProperty(java.lang.String propertyName)` Gets bean property without looking in superclasses or interfaces.
    `BeanProperty` | `getBeanProperty(java.lang.String propertyName, boolean superclasses)`
    `JavaClass[]` | `getClasses()` Deprecated. Use `getNestedClasses()` instead.
    `java.lang.String` | `getClassNamePrefix()`
    `JavaClass[]` | `getDerivedClasses()` Gets the known derived classes.
    `JavaField` | `getFieldByName(java.lang.String name)`
    `JavaField[]` | `getFields()`
    `java.lang.String` | `getFullyQualifiedName()`
    `JavaClass[]` | `getImplementedInterfaces()`
    `Type[]` | `getImplements()`
    `JavaClass` | `getInnerClassByName(java.lang.String name)` Deprecated. old name for `getNestedClassByName(String)`
    `JavaClass[]` | `getInnerClasses()` Deprecated. old name for `getNestedClasses()`
    `JavaClassContext` | `getJavaClassContext()`
    `JavaMethod` | `getMethod(java.lang.String name, Type[] parameterTypes, boolean varArgs)` This should be the signature for getMethodBySignature
    `JavaMethod` | `getMethodBySignature(java.lang.String name, Type[] parameterTypes)`
    `JavaMethod` | `getMethodBySignature(java.lang.String name, Type[] parameterTypes, boolean superclasses)`
    `JavaMethod` | `getMethodBySignature(java.lang.String name, Type[] parameterTypes, boolean superclasses, boolean varArg)`
    `JavaMethod[]` | `getMethods()`
    `JavaMethod[]` | `getMethods(boolean superclasses)`
    `JavaMethod[]` | `getMethodsBySignature(java.lang.String name, Type[] parameterTypes, boolean superclasses)`
    `JavaMethod[]` | `getMethodsBySignature(java.lang.String name, Type[] parameterTypes, boolean superclasses, boolean varArg)`
    `JavaClass` | `getNestedClassByName(java.lang.String name)`
    `JavaClass[]` | `getNestedClasses()`
    `JavaPackage` | `getPackage()`
    `java.lang.String` | `getPackageName()` If this class has a package, the packagename will be returned.
    `JavaClassParent` | `getParent()`
    `JavaSource` | `getParentSource()`
    `JavaSource` | `getSource()`
    `Type` | `getSuperClass()`
    `JavaClass` | `getSuperJavaClass()` Shorthand for getSuperClass().getJavaClass() with null checking.
    `DocletTag[]` | `getTagsByName(java.lang.String name, boolean superclasses)`
    `TypeVariable[]` | `getTypeParameters()`
    `boolean` | `isA(JavaClass javaClass)`
    `boolean` | `isA(java.lang.String fullClassName)`
    `boolean` | `isEnum()` is enum? (otherwise class or interface)
    `boolean` | `isInner()`
    `boolean` | `isInterface()` is interface? (otherwise enum or class)
    `java.lang.String` | `resolveType(java.lang.String typeName)` Resolve a type-name within the context of this source or class.
    `void` | `setAnnotation(boolean isAnnotation)`
    `void` | `setEnum(boolean isEnum)`
    `void` | `setImplementz(Type[] implementz)`
    `void` | `setInterface(boolean interfce)`
    `void` | `setJavaClassContext(JavaClassContext context)`
    `void` | `setJavaPackage(JavaPackage javaPackage)` Only used when constructing the model by hand / without source
    `void` | `setSource(JavaSource source)`
    `void` | `setSuperClass(Type type)`
    `void` | `setTypeParameters(TypeVariable[] typeParameters)`
    `java.lang.String` | `toString()`
    `protected void` | `writeBody(IndentBuffer result)`

    - ### Methods inherited from class com.thoughtworks.qdox.model.AbstractInheritableJavaEntity

      `getTagByName`

    - ### Methods inherited from class com.thoughtworks.qdox.model.AbstractJavaEntity

      `getCodeBlock, getComment, getModifiers, getNamedParameter, getParentClass, getTagByName, getTags, getTagsByName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setComment, setModifiers, setParentClass, setTags, write, writeAccessibilityModifier, writeAllModifiers, writeNonAccessibilityModifiers`

    - ### Methods inherited from class com.thoughtworks.qdox.model.AbstractBaseJavaEntity

      `getAnnotations, getLineNumber, getName, setAnnotations, setLineNumber, setName, setParent`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaClass

          public JavaClass()

    - #### JavaClass

          public JavaClass(java.lang.String name)

  - ### Method Detail

    - #### setJavaClassContext

          public void setJavaClassContext(JavaClassContext context)

    - #### isInterface

          public boolean isInterface()

      is interface? (otherwise enum or class)

    - #### isEnum

          public boolean isEnum()

      is enum? (otherwise class or interface)

    - #### getSuperClass

          public Type getSuperClass()

    - #### getSuperJavaClass

          public JavaClass getSuperJavaClass()

      Shorthand for getSuperClass().getJavaClass() with null checking.

    - #### getImplements

          public Type[] getImplements()

    - #### getImplementedInterfaces

          public JavaClass[] getImplementedInterfaces()

      Since:
        1.3

    - #### writeBody

          protected void writeBody(IndentBuffer result)

      Specified by:
        `writeBody` in class `AbstractJavaEntity`

    - #### setInterface

          public void setInterface(boolean interfce)

    - #### setEnum

          public void setEnum(boolean isEnum)

    - #### setAnnotation

          public void setAnnotation(boolean isAnnotation)

    - #### addMethod

          public void addMethod(JavaMethod meth)

    - #### setSuperClass

          public void setSuperClass(Type type)

    - #### setImplementz

          public void setImplementz(Type[] implementz)

    - #### getTypeParameters

          public TypeVariable[] getTypeParameters()

    - #### setTypeParameters

          public void setTypeParameters(TypeVariable[] typeParameters)

    - #### addField

          public void addField(JavaField javaField)

    - #### setJavaPackage

          public void setJavaPackage(JavaPackage javaPackage)

      Only used when constructing the model by hand / without source
      Parameters:
        `javaPackage` -

    - #### setSource

          public void setSource(JavaSource source)

    - #### getParentSource

          public JavaSource getParentSource()

      Specified by:
        `getParentSource` in interface `JavaClassParent`

    - #### getSource

          public JavaSource getSource()

      Overrides:
        `getSource` in class `AbstractJavaEntity`

    - #### getPackage

          public JavaPackage getPackage()

    - #### getParent

          public JavaClassParent getParent()

      Overrides:
        `getParent` in class `AbstractBaseJavaEntity`
      Returns:

    - #### getPackageName

          public java.lang.String getPackageName()

      If this class has a package, the packagename will be returned. Otherwise an empty String.
      Returns:

    - #### getFullyQualifiedName

          public java.lang.String getFullyQualifiedName()

    - #### isInner

          public boolean isInner()

      Since:
        1.3

    - #### resolveType

          public java.lang.String resolveType(java.lang.String typeName)

      Description copied from interface: `JavaClassParent`
      Resolve a type-name within the context of this source or class.
      Specified by:
        `resolveType` in interface `JavaClassParent`
      Parameters:
        `typeName` - name of a type
      Returns:
        the fully-qualified name of the type, or null if it cannot be resolved

    - #### getJavaClassContext

          public JavaClassContext getJavaClassContext()

      Specified by:
        `getJavaClassContext` in interface `JavaClassParent`

    - #### getClassNamePrefix

          public java.lang.String getClassNamePrefix()

      Specified by:
        `getClassNamePrefix` in interface `JavaClassParent`

    - #### asType

          public Type asType()

    - #### getMethods

          public JavaMethod[] getMethods()

    - #### getMethods

          public JavaMethod[] getMethods(boolean superclasses)

      Since:
        1.3

    - #### getMethodBySignature

          public JavaMethod getMethodBySignature(java.lang.String name,
                                        Type[] parameterTypes)

      Parameters:
        `name` - method name
        `parameterTypes` - parameter types or null if there are no parameters.
      Returns:
        the matching method or null if no match is found.

    - #### getMethod

          public JavaMethod getMethod(java.lang.String name,
                             Type[] parameterTypes,
                             boolean varArgs)

      This should be the signature for getMethodBySignature
      Parameters:
        `name` -
        `parameterTypes` -
        `varArgs` -
      Returns:

    - #### getMethodBySignature

          public JavaMethod getMethodBySignature(java.lang.String name,
                                        Type[] parameterTypes,
                                        boolean superclasses)

      Parameters:
        `name` -
        `parameterTypes` -
        `superclasses` -
      Returns:

    - #### getMethodBySignature

          public JavaMethod getMethodBySignature(java.lang.String name,
                                        Type[] parameterTypes,
                                        boolean superclasses,
                                        boolean varArg)

      Parameters:
        `name` -
        `parameterTypes` -
        `superclasses` -
        `varArg` -
      Returns:

    - #### getMethodsBySignature

          public JavaMethod[] getMethodsBySignature(java.lang.String name,
                                           Type[] parameterTypes,
                                           boolean superclasses)

      Parameters:
        `name` -
        `parameterTypes` -
        `superclasses` -
      Returns:

    - #### getMethodsBySignature

          public JavaMethod[] getMethodsBySignature(java.lang.String name,
                                           Type[] parameterTypes,
                                           boolean superclasses,
                                           boolean varArg)

      Parameters:
        `name` -
        `parameterTypes` -
        `superclasses` -
        `varArg` -
      Returns:

    - #### getFields

          public JavaField[] getFields()

    - #### getFieldByName

          public JavaField getFieldByName(java.lang.String name)

    - #### addClass

          public void addClass(JavaClass cls)

      Specified by:
        `addClass` in interface `JavaClassParent`

    - #### getClasses

          public JavaClass[] getClasses()

      Deprecated. Use `getNestedClasses()` instead.

    - #### getNestedClasses

          public JavaClass[] getNestedClasses()

      Since:
        1.3

    - #### getNestedClassByName

          public JavaClass getNestedClassByName(java.lang.String name)

      Specified by:
        `getNestedClassByName` in interface `JavaClassParent`

    - #### getInnerClasses

          public JavaClass[] getInnerClasses()

      Deprecated. old name for `getNestedClasses()`

    - #### getInnerClassByName

          public JavaClass getInnerClassByName(java.lang.String name)

      Deprecated. old name for `getNestedClassByName(String)`

    - #### isA

          public boolean isA(java.lang.String fullClassName)

      Since:
        1.3

    - #### isA

          public boolean isA(JavaClass javaClass)

      Since:
        1.3

    - #### getBeanProperties

          public BeanProperty[] getBeanProperties()

      Gets bean properties without looking in superclasses or interfaces.
      Since:
        1.3

    - #### getBeanProperties

          public BeanProperty[] getBeanProperties(boolean superclasses)

      Since:
        1.3

    - #### getBeanProperty

          public BeanProperty getBeanProperty(java.lang.String propertyName)

      Gets bean property without looking in superclasses or interfaces.
      Since:
        1.3

    - #### getBeanProperty

          public BeanProperty getBeanProperty(java.lang.String propertyName,
                                     boolean superclasses)

      Since:
        1.3

    - #### getDerivedClasses

          public JavaClass[] getDerivedClasses()

      Gets the known derived classes. That is, subclasses or implementing classes.

    - #### getTagsByName

          public DocletTag[] getTagsByName(java.lang.String name,
                                  boolean superclasses)

      Specified by:
        `getTagsByName` in class `AbstractInheritableJavaEntity`

    - #### compareTo

          public int compareTo(java.lang.Object o)

      Specified by:
        `compareTo` in interface `java.lang.Comparable`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`
      See Also:
        `http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#toString()`