- 所有已实现的接口:
JavaAnnotatedElement,JavaClass,JavaGenericDeclaration,JavaModel,JavaType,Serializable
- 作者:
- Joe Walnes, Aslak Hellesøy
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidvoidaddConstructor(JavaConstructor constructor) voidvoidaddInitializer(JavaInitializer initializer) voidaddMethod(JavaMethod meth) booleanGets bean properties without looking in superclasses or interfaces.getBeanProperties(boolean superclasses) getBeanProperty(String propertyName) Gets bean property without looking in superclasses or interfaces.getBeanProperty(String propertyName, boolean superclasses) The class or interface must be named by its binary name, which must meet the following constraints: The binary name of a top level type is its canonical name. The binary name of a member type consists of the binary name of its immediately enclosing type, followed by $, followed by the simple name of the member.Equivalent of (@linkClass.getCanonicalName().Equivalent ofClass.getComponentType()If this type is an array, return its component typegetConstructor(List<JavaType> parameterTypes) getConstructor(List<JavaType> parameterTypes, boolean varArgs) Equivalent ofClass.getConstructors()Equivalent ofClass.getClasses()Gets the known derived classes.intReturns the depth of this array, 0 if it's not an arraygetEnumConstantByName(String name) Based onClass.getEnumConstants().getFieldByName(String name) Equivalent ofClass.getField(String), where this method can resolve every fieldgetFieldByName(String name, boolean publicOnly, boolean supperClass) Equivalent ofClass.getFields()getFields(boolean publicOnly, boolean supperClass) Every primitive type, named package, top level class, and top level interface has a fully qualified name: The fully qualified name of a primitive type is the keyword for that primitive type, namely byte, short, char, int, long, float, double, or boolean. The fully qualified name of a named package that is not a subpackage of a named package is its simple name. The fully qualified name of a named package that is a subpackage of another named package consists of the fully qualified name of the containing package, followed by ".", followed by the simple (member) name of the subpackage. The fully qualified name of a top level class or top level interface that is declared in an unnamed package is the simple name of the class or interface. The fully qualified name of a top level class or top level interface that is declared in a named package consists of the fully qualified name of the package, followed by ".", followed by the simple name of the class or interface. Each member class, member interface, and array type may have a fully qualified name: A member class or member interface M of another class or interface C has a fully qualified name if and only if C has a fully qualified name. In that case, the fully qualified name of M consists of the fully qualified name of C, followed by ".", followed by the simple name of M. An array type has a fully qualified name if and only if its element type has a fully qualified name. In that case, the fully qualified name of an array type consists of the fully qualified name of the component type of the array type followed by "[]". Some examples how names will be translatedThe canonical name with generic information.The fully qualified name with generic information.A java5+ representation of the class.A list ifJavaInitializer, either static or instance initializers.Equivalent ofClass.getInterfaces()Determines the interfaces implemented by the class or interface represented by this object.This should be the signature for getMethodBySignature.getMethodBySignature(String name, List<JavaType> parameterTypes) getMethodBySignature(String name, List<JavaType> parameterTypes, boolean superclasses) getMethodBySignature(String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg) Equivalent ofClass.getMethods()getMethods(boolean superclasses) Return declared methods and optionally the inherited methodsgetMethodsBySignature(String name, List<JavaType> parameterTypes, boolean superclasses) getMethodsBySignature(String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg) getNestedClassByName(String name) Equivalent ofClass.getDeclaredClasses()Equivalent ofClass.getPackage()If this class has a package, the packagename will be returned.Equivalent ofClass.getSimpleName().The compilation unit, which includes the imports, the public and anonymous classesShorthand for getSuperClass().getJavaClass() with null checking.getTagsByName(String name, boolean superclasses) Equivalent ofGenericDeclaration.getTypeParameters()getValue()If there's a reference to this class, use the value used in the code.inthashCode()booleanbooleanboolean(API description ofClass.isAnnotation())booleanisArray()booleanisEnum()(API description ofClass.isEnum())booleanisInner()boolean(API description ofClass.isInterface())booleanEquivalent ofClass.isPrimitive()booleanisRecord()(API description ofClass.isRecord())booleanisVoid()voidsetAnnotation(boolean anAnnotation) voidsetEnum(boolean anEnum) voidsetImplementz(List<JavaClass> implementz) voidsetInterface(boolean anInterface) voidsetJavaPackage(JavaPackage javaPackage) Only used when constructing the model by hand / without sourcevoidsetRecord(boolean aRecord) voidsetSuperClass(JavaType type) voidsetTypeParameters(List<DefaultJavaTypeVariable<JavaClass>> typeParameters) toString()(API description ofClass.toString()) Converts the object to a string.从类继承的方法 com.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity
getTagByName从类继承的方法 com.thoughtworks.qdox.model.impl.AbstractJavaEntity
getDeclaringClass, getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setDeclaringClass, setModifiers, setName从类继承的方法 com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTags从类继承的方法 com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactory从接口继承的方法 com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName从接口继承的方法 com.thoughtworks.qdox.model.JavaClass
getDeclaringClass, getModifiers, getName, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic从接口继承的方法 com.thoughtworks.qdox.model.JavaModel
getLineNumber
-
构造器详细资料
-
DefaultJavaClass
protected DefaultJavaClass() -
DefaultJavaClass
-
DefaultJavaClass
-
-
方法详细资料
-
isInterface
public boolean isInterface()(API description ofClass.isInterface())Determines if the specified
Classobject represents an interface type.- 指定者:
isInterface在接口中JavaClass- 返回:
trueif this object represents an interface, otherwisefalse
-
isPrimitive
public boolean isPrimitive()Equivalent ofClass.isPrimitive()- 指定者:
isPrimitive在接口中JavaClass- 返回:
trueif this class represents a primitive, otherwisefalse
-
isVoid
public boolean isVoid() -
isEnum
public boolean isEnum()(API description ofClass.isEnum())Returns
trueif and only if this class was declared as an enum in the source code. -
isRecord
public boolean isRecord()(API description ofClass.isRecord())Returns
trueif and only if this class was declared as a record in the source code. -
isAnnotation
public boolean isAnnotation()(API description ofClass.isAnnotation())Returns true if this
Classobject represents an annotation type. Note that if this method returns true,JavaClass.isInterface()would also return true, as all annotation types are also interfaces.- 指定者:
isAnnotation在接口中JavaClass- 返回:
trueif this object represents an annotation, otherwisefalse
-
isArray
public boolean isArray() -
getComponentType
Equivalent ofClass.getComponentType()If this type is an array, return its component type- 指定者:
getComponentType在接口中JavaClass- 返回:
- the type of array if it's one, otherwise
null
-
getDimensions
public int getDimensions()Returns the depth of this array, 0 if it's not an array- 指定者:
getDimensions在接口中JavaClass- 返回:
- The depth of this array, at least
0
-
getSuperClass
- 指定者:
getSuperClass在接口中JavaClass
-
getSuperJavaClass
Shorthand for getSuperClass().getJavaClass() with null checking.- 指定者:
getSuperJavaClass在接口中JavaClass- 返回:
- the super class as
JavaClass
-
getImplements
- 指定者:
getImplements在接口中JavaClass
-
getInterfaces
Equivalent ofClass.getInterfaces()Determines the interfaces implemented by the class or interface represented by this object.- 指定者:
getInterfaces在接口中JavaClass- 返回:
- a list of interfaces, never
null
-
getCodeBlock
- 指定者:
getCodeBlock在接口中JavaClass- 指定者:
getCodeBlock在接口中JavaModel- 返回:
- the codeblock
-
setInterface
public void setInterface(boolean anInterface) -
setEnum
public void setEnum(boolean anEnum) -
setRecord
public void setRecord(boolean aRecord) -
setAnnotation
public void setAnnotation(boolean anAnnotation) -
addConstructor
-
addMethod
-
setSuperClass
-
setImplementz
-
getTypeParameters
Equivalent ofGenericDeclaration.getTypeParameters()- 指定者:
getTypeParameters在接口中JavaGenericDeclaration- 返回:
- a list of typeParameters, never
null
-
setTypeParameters
-
addField
-
setJavaPackage
Only used when constructing the model by hand / without source- 参数:
javaPackage- the package
-
getParentSource
- 指定者:
getParentSource在接口中JavaClass
-
getSource
The compilation unit, which includes the imports, the public and anonymous classes- 指定者:
getSource在接口中JavaClass- 覆盖:
getSource在类中AbstractBaseJavaEntity- 返回:
- the
JavaSourceof this element
-
getPackage
Equivalent ofClass.getPackage()- 指定者:
getPackage在接口中JavaClass- 返回:
- the package
-
getPackageName
If this class has a package, the packagename will be returned. Otherwise an empty String.- 指定者:
getPackageName在接口中JavaClass- 返回:
- the name of the package, otherwise an empty String
-
getSimpleName
Equivalent ofClass.getSimpleName().- 指定者:
getSimpleName在接口中JavaClass- 返回:
- the simple name of the underlying class as given in the source code.
-
getBinaryName
The class or interface must be named by its binary name, which must meet the following constraints:
- The binary name of a top level type is its canonical name.
- The binary name of a member type consists of the binary name of its immediately enclosing type, followed by $, followed by the simple name of the member.
- 指定者:
getBinaryName在接口中JavaType- 返回:
- the binary name
- 另请参阅:
-
getFullyQualifiedName
Every primitive type, named package, top level class, and top level interface has a fully qualified name:
Some examples how names will be translated- The fully qualified name of a primitive type is the keyword for that primitive type, namely byte, short, char, int, long, float, double, or boolean.
- The fully qualified name of a named package that is not a subpackage of a named package is its simple name.
- The fully qualified name of a named package that is a subpackage of another named package consists of the fully qualified name of the containing package, followed by ".", followed by the simple (member) name of the subpackage.
- The fully qualified name of a top level class or top level interface that is declared in an unnamed package is the simple name of the class or interface.
- The fully qualified name of a top level class or top level interface that is declared in a named package consists of the fully qualified name of the package, followed by ".", followed by the simple name of the class or interface.
- A member class or member interface M of another class or interface C has a fully qualified name if and only if C has a fully qualified name.
- In that case, the fully qualified name of M consists of the fully qualified name of C, followed by ".", followed by the simple name of M.
- An array type has a fully qualified name if and only if its element type has a fully qualified name.
- In that case, the fully qualified name of an array type consists of the fully qualified name of the component type of the array type followed by "[]".
Object > java.lang.Object java.util.List > java.util.List ? > ? T > T anypackage.Outer.Inner > anypackage.Outer.Inner String[][] > java.lang.String[][]
- 指定者:
getFullyQualifiedName在接口中JavaType- 返回:
- the fully qualified name, never
null - 另请参阅:
-
getGenericFullyQualifiedName
The fully qualified name with generic information.- 指定者:
getGenericFullyQualifiedName在接口中JavaType- 返回:
- the generic fully qualified name
-
getCanonicalName
Equivalent of (@linkClass.getCanonicalName().- 指定者:
getCanonicalName在接口中JavaType- 返回:
- the canonical name of this class
-
getGenericCanonicalName
The canonical name with generic information.- 指定者:
getGenericCanonicalName在接口中JavaType- 返回:
- the generic canonical name
-
getValue
If there's a reference to this class, use the value used in the code. Otherwise return the simple name. When including all imports, you should be safe to use this method. This won't return generics, so it's java1.4 safe. Examples:private String fieldA; // getValue() will return "String" private java.lang.String fieldA; // getValue() will return "java.lang.String" private List>String> aList; // getValue() will return "List"
-
getGenericValue
A java5+ representation of the class. When including all imports, you should be safe to use this method. Examples:private String fieldA; // getValue() will return "String" private java.lang.String fieldA; // getValue() will return "java.lang.String" private List>String> aList; // getValue() will return "List>String>"
- 指定者:
getGenericValue在接口中JavaType- 返回:
- the generic name of the class as used in the source
-
isInner
public boolean isInner() -
getInitializers
A list ifJavaInitializer, either static or instance initializers.- 指定者:
getInitializers在接口中JavaClass- 返回:
- a List of initializers
-
getConstructors
Equivalent ofClass.getConstructors()- 指定者:
getConstructors在接口中JavaClass- 返回:
- the list of constructors
-
getConstructor
- 指定者:
getConstructor在接口中JavaClass- 参数:
parameterTypes- the parameter types of the constructor, can benull- 返回:
- the matching constructor, otherwise
null
-
getConstructor
- 指定者:
getConstructor在接口中JavaClass- 参数:
parameterTypes- the parameter types of the constructor, can benullvarArgs- define is the constructor has varArgs- 返回:
- the matching constructor, otherwise
null
-
getMethods
Equivalent ofClass.getMethods()- 指定者:
getMethods在接口中JavaClass- 返回:
- the methods declared or overridden in this class
-
getMethods
Return declared methods and optionally the inherited methods- 指定者:
getMethods在接口中JavaClass- 参数:
superclasses-trueif inherited methods should be returned as well- 返回:
- all methods
-
getMethodBySignature
- 指定者:
getMethodBySignature在接口中JavaClass- 参数:
name- the name of the methodparameterTypes- the parameter types of the method, can benull.- 返回:
- the matching method, otherwise
null
-
getMethod
This should be the signature for getMethodBySignature. -
getMethodBySignature
public JavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes, boolean superclasses) - 指定者:
getMethodBySignature在接口中JavaClass- 参数:
name- the name of the methodparameterTypes- the parameter types of the method, can benullsuperclasses- to define if superclasses should be included as well- 返回:
- the matching method, otherwise
null
-
getMethodBySignature
public JavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg) - 指定者:
getMethodBySignature在接口中JavaClass- 参数:
name- the name of the methodparameterTypes- the parameter types of the method, can benullsuperclasses-trueif inherited methods should be matched as wellvarArg- define if the method has varArgs- 返回:
- the matching method, otherwise
null
-
getMethodsBySignature
public List<JavaMethod> getMethodsBySignature(String name, List<JavaType> parameterTypes, boolean superclasses) - 指定者:
getMethodsBySignature在接口中JavaClass- 参数:
name- the name of the methodparameterTypes- the parameter types of the method, can benullsuperclasses-trueif inherited methods should be matched as well- 返回:
- the matching methods, otherwise
null
-
getMethodsBySignature
public List<JavaMethod> getMethodsBySignature(String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg) - 指定者:
getMethodsBySignature在接口中JavaClass- 参数:
name- the name of the methodparameterTypes- the parameter types of the method, can benullsuperclasses-trueif inherited methods should be matched as wellvarArg- define if the method has varArgs- 返回:
- the matching methods, otherwise
null
-
getFields
Equivalent ofClass.getFields() -
getFieldByName
Equivalent ofClass.getField(String), where this method can resolve every field- 指定者:
getFieldByName在接口中JavaClass- 参数:
name- the name of the field- 返回:
- the field
-
getFields
-
getFieldByName
- 指定者:
getFieldByName在接口中JavaClass
-
getEnumConstants
Based onClass.getEnumConstants().- 指定者:
getEnumConstants在接口中JavaClass- 返回:
- a List of enum constants if this class is an
enum, otherwisenull
-
getEnumConstantByName
- 指定者:
getEnumConstantByName在接口中JavaClass- 参数:
name- the name of the enum constant- 返回:
- the enumConstant matching the
name, otherwisenull
-
addInitializer
-
addClass
-
getNestedClasses
Equivalent ofClass.getDeclaredClasses()- 指定者:
getNestedClasses在接口中JavaClass- 返回:
- a list of declared classes, never
null
-
getNestedClassByName
- 指定者:
getNestedClassByName在接口中JavaClass
-
isA
-
isA
-
getBeanProperties
Gets bean properties without looking in superclasses or interfaces.- 指定者:
getBeanProperties在接口中JavaClass- 返回:
- the bean properties
-
getBeanProperties
- 指定者:
getBeanProperties在接口中JavaClass- 参数:
superclasses- to define if superclasses should be included as well- 返回:
- the bean properties
-
getBeanProperty
Gets bean property without looking in superclasses or interfaces.- 指定者:
getBeanProperty在接口中JavaClass- 参数:
propertyName- the name of the property- 返回:
- the bean property
-
getBeanProperty
- 指定者:
getBeanProperty在接口中JavaClass- 参数:
propertyName- the name of the propertysuperclasses- to define if superclasses should be included as well- 返回:
- the bean property
-
getDerivedClasses
Equivalent ofClass.getClasses()Gets the known derived classes. That is, subclasses or implementing classes.- 指定者:
getDerivedClasses在接口中JavaClass- 返回:
- the derived classes
-
getTagsByName
- 指定者:
getTagsByName在接口中JavaClass- 指定者:
getTagsByName在类中AbstractInheritableJavaEntity
-
toString
从接口复制的说明:JavaClass(API description ofClass.toString()) Converts the object to a string. The string representation is the string "class" or "interface", followed by a space, and then by the fully qualified name of the class in the format returned bygetName. If thisClassobject represents a primitive type, this method returns the name of the primitive type. If thisClassobject represents void this method returns "void". -
toGenericString
- 指定者:
toGenericString在接口中JavaType
-
hashCode
public int hashCode() -
equals
-
getJavaClassLibrary
- 指定者:
getJavaClassLibrary在接口中JavaClass
-