public interface JavaClass extends JavaModel, JavaType, JavaClassParent, JavaAnnotatedElement, JavaGenericDeclaration
Class, providing the most important methods.
Where the original Class is using an Array, this model is using a List.| Modifier and Type | Method and Description |
|---|---|
JavaType |
asType()
Deprecated.
the JavaClass should have the same methods
|
List<BeanProperty> |
getBeanProperties()
Gets bean properties without looking in superclasses or interfaces.
|
List<BeanProperty> |
getBeanProperties(boolean superclasses) |
BeanProperty |
getBeanProperty(String propertyName)
Gets bean property without looking in superclasses or interfaces.
|
BeanProperty |
getBeanProperty(String propertyName,
boolean superclasses) |
List<JavaClass> |
getClasses()
Deprecated.
Use
getNestedClasses() instead. |
String |
getClassNamePrefix()
If this class has a package, it will return the package name, followed by a "."(dot).
|
String |
getCodeBlock() |
JavaClass |
getComponentType()
Equivalent of
Class.getComponentType()
If this type is an array, return its component type |
JavaConstructor |
getConstructor(List<JavaType> parameterTypes) |
JavaConstructor |
getConstructor(List<JavaType> parameterTypes,
boolean varArg) |
List<JavaConstructor> |
getConstructors()
Equivalent of
Class.getConstructors() |
JavaClass |
getDeclaringClass() |
List<JavaClass> |
getDerivedClasses()
Equivalent of
Class.getClasses()
Gets the known derived classes. |
int |
getDimensions() |
JavaField |
getEnumConstantByName(String name) |
List<JavaField> |
getEnumConstants()
Based on
Class.getEnumConstants(). |
JavaField |
getFieldByName(String name)
Equivalent of
Class.getField(String), where this method can resolve every field |
List<JavaField> |
getFields()
Equivalent of
Class.getFields() |
List<JavaClass> |
getImplementedInterfaces() |
List<JavaType> |
getImplements() |
List<JavaInitializer> |
getInitializers()
A list if
JavaInitializer, either static or instance initializers. |
JavaClass |
getInnerClassByName(String name)
Deprecated.
use
getNestedClassByName(String) instead |
List<JavaClass> |
getInnerClasses()
Deprecated.
use
getNestedClasses() instead |
List<JavaClass> |
getInterfaces()
Equivalent of
Class.getInterfaces()
Determines the interfaces implemented by the class or interface represented by this object. |
ClassLibrary |
getJavaClassLibrary() |
JavaMethod |
getMethod(String name,
List<JavaType> parameterTypes,
boolean varArgs)
This should be the signature for getMethodBySignature.
|
JavaMethod |
getMethodBySignature(String name,
List<JavaType> parameterTypes) |
JavaMethod |
getMethodBySignature(String name,
List<JavaType> parameterTypes,
boolean superclasses) |
JavaMethod |
getMethodBySignature(String name,
List<JavaType> parameterTypes,
boolean superclasses,
boolean varArg) |
List<JavaMethod> |
getMethods()
Equivalent of
Class.getMethods() |
List<JavaMethod> |
getMethods(boolean superclasses) |
List<JavaMethod> |
getMethodsBySignature(String name,
List<JavaType> parameterTypes,
boolean superclasses) |
List<JavaMethod> |
getMethodsBySignature(String name,
List<JavaType> parameterTypes,
boolean superclasses,
boolean varArg) |
List<String> |
getModifiers()
Equivalent of
Class.getModifiers()
This does not follow the java-api
The Class.getModifiers() returns an int, which should be decoded with the Modifier. |
String |
getName()
Equivalent of
Class.getName(). |
JavaClass |
getNestedClassByName(String name) |
List<JavaClass> |
getNestedClasses()
Equivalent of
Class.getDeclaredClasses() |
JavaPackage |
getPackage()
Equivalent of
Class.getPackage() |
String |
getPackageName()
If this class has a package, the packagename will be returned.
|
JavaClassParent |
getParent()
Deprecated.
|
JavaSource |
getParentSource() |
JavaType |
getSuperClass() |
JavaClass |
getSuperJavaClass()
Shorthand for getSuperClass().getJavaClass() with null checking.
|
List<DocletTag> |
getTagsByName(String name,
boolean superclasses) |
boolean |
isA(JavaClass javaClass) |
boolean |
isA(String fullyQualifiedName) |
boolean |
isAbstract()
(API description of
Modifier.isAbstract(int))
Return true if the class includes the abstract modifier, false otherwise. |
boolean |
isAnnotation()
(API description of
Class.isAnnotation()) |
boolean |
isArray() |
boolean |
isEnum()
(API description of
Class.isEnum()) |
boolean |
isFinal()
(API description of
Modifier.isFinal(int)) |
boolean |
isInner() |
boolean |
isInterface()
(API description of
Class.isInterface()) |
boolean |
isPrimitive()
Equivalent of
Class.isPrimitive() |
boolean |
isPrivate()
(API description of
Modifier.isPrivate(int)) |
boolean |
isProtected()
(API description of
Modifier.isProtected(int)) |
boolean |
isPublic()
(API description of
Modifier.isPublic(int)) |
boolean |
isStatic()
(API description of
Modifier.isStatic(int)) |
boolean |
isVoid() |
String |
resolveCanonicalName(String name)
The name can be both absolute (including the package) or relative (matching a subclass or an import).
|
String |
resolveFullyQualifiedName(String name)
The name can be both absolute (including the package) or relative (matching a subclass or an import).
|
String |
resolveType(String name)
Deprecated.
use
resolveCanonicalName(String) or resolveFullyQualifiedName(String) instead |
String |
toString()
(API description of
Class.toString())
Converts the object to a string. |
getLineNumber, getSourcegetCanonicalName, getFullyQualifiedName, getGenericCanonicalName, getGenericFullyQualifiedName, getGenericValue, getValue, toGenericStringgetAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNamegetTypeParametersJavaType asType()
List<JavaClass> getClasses()
getNestedClasses() instead.JavaClass getInnerClassByName(String name)
getNestedClassByName(String) insteadList<JavaClass> getInnerClasses()
getNestedClasses() insteadJavaClassParent getParent()
getParentSource() or getDeclaringClass()String resolveType(String name)
resolveCanonicalName(String) or resolveFullyQualifiedName(String) insteadJavaClassParentresolveType in interface JavaClassParentname - name of a typeboolean isInterface()
Class.isInterface())
Determines if the specified Class object represents an interface type.
true if this object represents an interface, otherwise falseboolean isEnum()
Class.isEnum())
Returns true if and only if this class was declared as an enum in the source code.
true if this object represents an enum, otherwise falseboolean isAnnotation()
Class.isAnnotation())
Returns true if this Class object represents an annotation type.
Note that if this method returns true, isInterface() would also return true, as all annotation types are also interfaces.
true if this object represents an annotation, otherwise falseJavaClass getDeclaringClass()
JavaType getSuperClass()
JavaClass getSuperJavaClass()
List<JavaClass> getInterfaces()
Class.getInterfaces()
Determines the interfaces implemented by the class or interface represented by this object. *nullString getCodeBlock()
getCodeBlock in interface JavaModelJavaSource getParentSource()
getParentSource in interface JavaClassParentJavaPackage getPackage()
Class.getPackage()String getPackageName()
boolean isInner()
true if this class is an inner class, otherwise falseString resolveCanonicalName(String name)
resolveCanonicalName in interface JavaClassParentname - the name to resolvenullString resolveFullyQualifiedName(String name)
resolveFullyQualifiedName in interface JavaClassParentname - the name to resolvenullString getClassNamePrefix()
List<JavaMethod> getMethods()
Class.getMethods()List<JavaConstructor> getConstructors()
Class.getConstructors()JavaConstructor getConstructor(List<JavaType> parameterTypes)
parameterTypes - the parameter types of the constructor, can be nullnullJavaConstructor getConstructor(List<JavaType> parameterTypes, boolean varArg)
parameterTypes - the parameter types of the constructor, can be nullvarArg - define is the constructor has varArgsnullList<JavaMethod> getMethods(boolean superclasses)
JavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes)
name - the name of the methodparameterTypes - the parameter types of the method, can be null.nullJavaMethod getMethod(String name, List<JavaType> parameterTypes, boolean varArgs)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullvarArgs - define if the method has varArgsnullJavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes, boolean superclasses)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - to define if superclasses should be included as wellnullJavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - varArg - define if the method has varArgsnullList<JavaMethod> getMethodsBySignature(String name, List<JavaType> parameterTypes, boolean superclasses)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - to define if superclasses should be included as wellnullList<JavaMethod> getMethodsBySignature(String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - to define if superclasses should be included as wellvarArg - define if the method has varArgsnullList<JavaField> getFields()
Class.getFields()nullJavaField getFieldByName(String name)
Class.getField(String), where this method can resolve every fieldname - List<JavaField> getEnumConstants()
Class.getEnumConstants().enum, otherwise nullJavaField getEnumConstantByName(String name)
name, otherwise nullList<JavaClass> getNestedClasses()
Class.getDeclaredClasses()nullJavaClass getNestedClassByName(String name)
getNestedClassByName in interface JavaClassParentboolean isA(String fullyQualifiedName)
boolean isA(JavaClass javaClass)
javaClass - int getDimensions()
boolean isArray()
true if this JavaClass is an array, otherwise falseboolean isVoid()
true if this JavaClass is a void, otherwise falseJavaClass getComponentType()
Class.getComponentType()
If this type is an array, return its component typenullList<BeanProperty> getBeanProperties()
List<BeanProperty> getBeanProperties(boolean superclasses)
superclasses - to define if superclasses should be included as wellBeanProperty getBeanProperty(String propertyName)
propertyName - the name of the propertyBeanProperty getBeanProperty(String propertyName, boolean superclasses)
propertyName - the name of the propertysuperclasses - to define if superclasses should be included as wellList<JavaClass> getDerivedClasses()
Class.getClasses()
Gets the known derived classes. That is, subclasses or implementing classes.ClassLibrary getJavaClassLibrary()
getJavaClassLibrary in interface JavaClassParentList<JavaInitializer> getInitializers()
JavaInitializer, either static or instance initializers.String getName()
Class.getName().List<String> getModifiers()
Class.getModifiers()
This does not follow the java-api
The Class.getModifiers() returns an int, which should be decoded with the Modifier.
This method will return a list of strings representing the modifiers.
If this member was extracted from a source, it will keep its order.
Otherwise if will be in the preferred order of the java-api.boolean isPublic()
Modifier.isPublic(int))
Return true if the class includes the public modifier, false otherwise.
true if class has the public modifier, otherwise falseboolean isProtected()
Modifier.isProtected(int))
Return true if the class includes the protected modifier, false otherwise.
true if class has the protected modifier, otherwise falseboolean isPrivate()
Modifier.isPrivate(int))
Return true if the class includes the private modifier, false otherwise.
true if class has the private modifier, otherwise falseboolean isFinal()
Modifier.isFinal(int))
Return true if the class includes the final modifier, false otherwise.
true if class has the final modifier, otherwise falseboolean isStatic()
Modifier.isStatic(int))
Return true if the class includes the static modifier, false otherwise.
true if class the static modifier, otherwise falseboolean isAbstract()
Modifier.isAbstract(int))
Return true if the class includes the abstract modifier, false otherwise.true if class has the abstract modifier, otherwise falseboolean isPrimitive()
Class.isPrimitive()true if this class represents a primitive, otherwise falseString toString()
Class.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 by getName.
If this Class object represents a primitive type, this method returns the name of the primitive type.
If this Class object represents void this method returns "void".Copyright © 2002–2016. All rights reserved.