com.thoughtworks.qdox.model
Class JavaClass

java.lang.Object
  extended by com.thoughtworks.qdox.model.AbstractBaseJavaEntity
      extended by com.thoughtworks.qdox.model.AbstractJavaEntity
          extended by com.thoughtworks.qdox.model.AbstractInheritableJavaEntity
              extended by com.thoughtworks.qdox.model.JavaClass
All Implemented Interfaces:
JavaClassParent, Serializable, Comparable

public class JavaClass
extends AbstractInheritableJavaEntity
implements JavaClassParent

Author:
Joe Walnes, Aslak Hellesøy
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
JavaClass()
           
JavaClass(String name)
           
 
Method Summary
 void addClass(JavaClass cls)
           
 void addField(JavaField javaField)
           
 void addMethod(JavaMethod meth)
           
 Type asType()
           
 int compareTo(Object o)
           
 BeanProperty[] getBeanProperties()
          Gets bean properties without looking in superclasses or interfaces.
 BeanProperty[] getBeanProperties(boolean superclasses)
           
 BeanProperty getBeanProperty(String propertyName)
          Gets bean property without looking in superclasses or interfaces.
 BeanProperty getBeanProperty(String propertyName, boolean superclasses)
           
 JavaClass[] getClasses()
          Deprecated. Use getNestedClasses() instead.
 String getClassNamePrefix()
           
 JavaClass[] getDerivedClasses()
          Gets the known derived classes.
 JavaField getFieldByName(String name)
           
 JavaField[] getFields()
           
 String getFullyQualifiedName()
           
 JavaClass[] getImplementedInterfaces()
           
 Type[] getImplements()
           
 JavaClass getInnerClassByName(String name)
          Deprecated. old name for getNestedClassByName(String)
 JavaClass[] getInnerClasses()
          Deprecated. old name for getNestedClasses()
 JavaClassContext getJavaClassContext()
           
 JavaMethod getMethodBySignature(String name, Type[] parameterTypes)
           
 JavaMethod getMethodBySignature(String name, Type[] parameterTypes, boolean superclasses)
           
 JavaMethod[] getMethods()
           
 JavaMethod[] getMethods(boolean superclasses)
           
 JavaMethod[] getMethodsBySignature(String name, Type[] parameterTypes, boolean superclasses)
           
 JavaClass getNestedClassByName(String name)
           
 JavaClass[] getNestedClasses()
           
 JavaPackage getPackage()
           
 String getPackageName()
          If this class has a package, the packagename will be returned.
 JavaClassParent getParent()
           
 JavaSource getParentSource()
           
 Type getSuperClass()
           
 JavaClass getSuperJavaClass()
          Shorthand for getSuperClass().getJavaClass() with null checking.
 DocletTag[] getTagsByName(String name, boolean superclasses)
           
 boolean isA(JavaClass javaClass)
           
 boolean isA(String fullClassName)
           
 boolean isEnum()
          is enum? (otherwise class or interface)
 boolean isInner()
           
 boolean isInterface()
          is interface? (otherwise enum or class)
 String resolveType(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)
           
 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, getSource, 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(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)

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

getPackage

public JavaPackage getPackage()

getParent

public JavaClassParent getParent()
Overrides:
getParent in class AbstractBaseJavaEntity
Returns:

getPackageName

public String getPackageName()
If this class has a package, the packagename will be returned. Otherwise an empty String.

Returns:

getFullyQualifiedName

public String getFullyQualifiedName()

isInner

public boolean isInner()
Since:
1.3

resolveType

public String resolveType(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 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(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.

getMethodBySignature

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

getMethodsBySignature

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

getFields

public JavaField[] getFields()

getFieldByName

public JavaField getFieldByName(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(String name)
Specified by:
getNestedClassByName in interface JavaClassParent

getInnerClasses

public JavaClass[] getInnerClasses()
Deprecated. old name for getNestedClasses()


getInnerClassByName

public JavaClass getInnerClassByName(String name)
Deprecated. old name for getNestedClassByName(String)


isA

public boolean isA(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(String propertyName)
Gets bean property without looking in superclasses or interfaces.

Since:
1.3

getBeanProperty

public BeanProperty getBeanProperty(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(String name,
                                 boolean superclasses)
Specified by:
getTagsByName in class AbstractInheritableJavaEntity

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

toString

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


Copyright © 2002-2011. All Rights Reserved.