public interface JavaClass extends JavaModel, JavaType, 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 |
|---|---|
java.util.List<BeanProperty> |
getBeanProperties()
Gets bean properties without looking in superclasses or interfaces.
|
java.util.List<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) |
java.lang.String |
getCodeBlock() |
JavaClass |
getComponentType()
Equivalent of
Class.getComponentType()
If this type is an array, return its component type |
JavaConstructor |
getConstructor(java.util.List<JavaType> parameterTypes) |
JavaConstructor |
getConstructor(java.util.List<JavaType> parameterTypes,
boolean varArg) |
java.util.List<JavaConstructor> |
getConstructors()
Equivalent of
Class.getConstructors() |
JavaClass |
getDeclaringClass() |
java.util.List<JavaClass> |
getDerivedClasses()
Equivalent of
Class.getClasses()
Gets the known derived classes. |
int |
getDimensions()
Returns the depth of this array, 0 if it's not an array
|
JavaField |
getEnumConstantByName(java.lang.String name) |
java.util.List<JavaField> |
getEnumConstants()
Based on
Class.getEnumConstants(). |
JavaField |
getFieldByName(java.lang.String name)
Equivalent of
Class.getField(String), where this method can resolve every field |
java.util.List<JavaField> |
getFields()
Equivalent of
Class.getFields() |
java.util.List<JavaType> |
getImplements() |
java.util.List<JavaInitializer> |
getInitializers()
A list if
JavaInitializer, either static or instance initializers. |
java.util.List<JavaClass> |
getInterfaces()
Equivalent of
Class.getInterfaces()
Determines the interfaces implemented by the class or interface represented by this object. |
ClassLibrary |
getJavaClassLibrary() |
JavaMethod |
getMethod(java.lang.String name,
java.util.List<JavaType> parameterTypes,
boolean varArgs)
This should be the signature for getMethodBySignature.
|
JavaMethod |
getMethodBySignature(java.lang.String name,
java.util.List<JavaType> parameterTypes) |
JavaMethod |
getMethodBySignature(java.lang.String name,
java.util.List<JavaType> parameterTypes,
boolean superclasses) |
JavaMethod |
getMethodBySignature(java.lang.String name,
java.util.List<JavaType> parameterTypes,
boolean superclasses,
boolean varArg) |
java.util.List<JavaMethod> |
getMethods()
Equivalent of
Class.getMethods() |
java.util.List<JavaMethod> |
getMethods(boolean superclasses)
Return declared methods and optionally the inherited methods
|
java.util.List<JavaMethod> |
getMethodsBySignature(java.lang.String name,
java.util.List<JavaType> parameterTypes,
boolean superclasses) |
java.util.List<JavaMethod> |
getMethodsBySignature(java.lang.String name,
java.util.List<JavaType> parameterTypes,
boolean superclasses,
boolean varArg) |
java.util.List<java.lang.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. |
java.lang.String |
getName()
Equivalent of
Class.getName(). |
JavaClass |
getNestedClassByName(java.lang.String name) |
java.util.List<JavaClass> |
getNestedClasses()
Equivalent of
Class.getDeclaredClasses() |
JavaPackage |
getPackage()
Equivalent of
Class.getPackage() |
java.lang.String |
getPackageName()
If this class has a package, the packagename will be returned.
|
JavaSource |
getParentSource() |
java.lang.String |
getSimpleName()
Equivalent of
Class.getSimpleName(). |
JavaSource |
getSource()
The compilation unit, which includes the imports, the public and anonymous classes
|
JavaType |
getSuperClass() |
JavaClass |
getSuperJavaClass()
Shorthand for getSuperClass().getJavaClass() with null checking.
|
java.util.List<DocletTag> |
getTagsByName(java.lang.String name,
boolean superclasses) |
boolean |
isA(JavaClass javaClass) |
boolean |
isA(java.lang.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())
Returns true if this Class object represents an annotation type. |
boolean |
isArray() |
boolean |
isEnum()
(API description of
Class.isEnum())
Returns true if and only if this class was declared as an enum in the source code. |
boolean |
isFinal()
(API description of
Modifier.isFinal(int))
Return true if the class includes the final modifier, false otherwise. |
boolean |
isInner() |
boolean |
isInterface()
(API description of
Class.isInterface())
Determines if the specified Class object represents an interface type. |
boolean |
isPrimitive()
Equivalent of
Class.isPrimitive() |
boolean |
isPrivate()
(API description of
Modifier.isPrivate(int))
Return true if the class includes the private modifier, false otherwise. |
boolean |
isProtected()
(API description of
Modifier.isProtected(int))
Return true if the class includes the protected modifier, false otherwise. |
boolean |
isPublic()
(API description of
Modifier.isPublic(int))
Return true if the class includes the public modifier, false otherwise. |
boolean |
isStatic()
(API description of
Modifier.isStatic(int))
Return true if the class includes the static modifier, false otherwise. |
boolean |
isVoid() |
java.lang.String |
toString()
(API description of
Class.toString())
Converts the object to a string. |
getBinaryName, getCanonicalName, getFullyQualifiedName, getGenericCanonicalName, getGenericFullyQualifiedName, getGenericValue, getValue, toGenericStringgetAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNamegetLineNumbergetTypeParametersJavaSource getSource()
JavaSource of this elementboolean 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()
JavaClassjava.util.List<JavaType> getImplements()
java.util.List<JavaClass> getInterfaces()
Class.getInterfaces()
Determines the interfaces implemented by the class or interface represented by this object.nulljava.lang.String getCodeBlock()
getCodeBlock in interface JavaModelJavaSource getParentSource()
JavaPackage getPackage()
Class.getPackage()java.lang.String getPackageName()
boolean isInner()
true if this class is an inner class, otherwise falsejava.util.List<JavaMethod> getMethods()
Class.getMethods()java.util.List<JavaConstructor> getConstructors()
Class.getConstructors()JavaConstructor getConstructor(java.util.List<JavaType> parameterTypes)
parameterTypes - the parameter types of the constructor, can be nullnullJavaConstructor getConstructor(java.util.List<JavaType> parameterTypes, boolean varArg)
parameterTypes - the parameter types of the constructor, can be nullvarArg - define is the constructor has varArgsnulljava.util.List<JavaMethod> getMethods(boolean superclasses)
superclasses - true if inherited methods should be returned as wellJavaMethod getMethodBySignature(java.lang.String name, java.util.List<JavaType> parameterTypes)
name - the name of the methodparameterTypes - the parameter types of the method, can be null.nullJavaMethod getMethod(java.lang.String name, java.util.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(java.lang.String name, java.util.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(java.lang.String name, java.util.List<JavaType> parameterTypes, boolean superclasses, boolean varArg)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - true if inherited methods should be matched as wellvarArg - define if the method has varArgsnulljava.util.List<JavaMethod> getMethodsBySignature(java.lang.String name, java.util.List<JavaType> parameterTypes, boolean superclasses)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - true if inherited methods should be matched as wellnulljava.util.List<JavaMethod> getMethodsBySignature(java.lang.String name, java.util.List<JavaType> parameterTypes, boolean superclasses, boolean varArg)
name - the name of the methodparameterTypes - the parameter types of the method, can be nullsuperclasses - true if inherited methods should be matched as wellvarArg - define if the method has varArgsnulljava.util.List<JavaField> getFields()
Class.getFields()nullJavaField getFieldByName(java.lang.String name)
Class.getField(String), where this method can resolve every fieldname - the name of the fieldjava.util.List<JavaField> getEnumConstants()
Class.getEnumConstants().enum, otherwise nullJavaField getEnumConstantByName(java.lang.String name)
name - the name of the enum constantname, otherwise nulljava.util.List<JavaClass> getNestedClasses()
Class.getDeclaredClasses()nullJavaClass getNestedClassByName(java.lang.String name)
boolean isA(java.lang.String fullyQualifiedName)
fullyQualifiedName - the FQN to match withtrue if this is of type FQN, otherwise falseboolean isA(JavaClass javaClass)
javaClass - the JavaClass to match withtrue if this is of type javaClass, otherwise falseint getDimensions()
0boolean 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 typenulljava.util.List<BeanProperty> getBeanProperties()
java.util.List<BeanProperty> getBeanProperties(boolean superclasses)
superclasses - to define if superclasses should be included as wellBeanProperty getBeanProperty(java.lang.String propertyName)
propertyName - the name of the propertyBeanProperty getBeanProperty(java.lang.String propertyName, boolean superclasses)
propertyName - the name of the propertysuperclasses - to define if superclasses should be included as welljava.util.List<JavaClass> getDerivedClasses()
Class.getClasses()
Gets the known derived classes. That is, subclasses or implementing classes.java.util.List<DocletTag> getTagsByName(java.lang.String name, boolean superclasses)
ClassLibrary getJavaClassLibrary()
java.util.List<JavaInitializer> getInitializers()
JavaInitializer, either static or instance initializers.java.lang.String getName()
Class.getName().java.lang.String getSimpleName()
Class.getSimpleName().java.util.List<java.lang.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 falsejava.lang.String 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".toString in class java.lang.ObjectCopyright © 2002-2018. All Rights Reserved.