- All Known Subinterfaces:
OVLClassType
public interface ClassType
-
Method Summary
Modifier and Type Method Description Object
cast(Object o)
List<? extends ClassType>
getAllInterfaces()
Returns a list of all implemented interfaces inclusive all interfaces implemented by supertypes.<A extends Annotation>
AgetAnnotation(Class<A> annotationClass)
Annotation[]
getAnnotations()
<T extends Annotation>
T[]getAnnotationsByType(Class<T> annotationClass)
List<? extends ClassType>
getClassHierarchy()
Returns a list containing the complete class hierarchy from the parent class until java.lang.Object.<A extends Annotation>
AgetDeclaredAnnotation(Class<A> annotationClass)
Annotation[]
getDeclaredAnnotations()
<T extends Annotation>
T[]getDeclaredAnnotationsByType(Class<T> annotationClass)
ClassType
getDeclaringClass()
String
getDisplayName()
Returns the displayed name of the type Example: java.lang.String[] instead of [java.lang.String;ClassType
getEnclosingClass()
Class<?>
getJavaType()
Returns the Java class represented by this instanceString
getName()
Returns the name of the type Example: java.lang.StringClassType
getParent()
Returns the supertype of this object.ClassType
getRawType()
Returns the raw type of a generic class type.String
getSimpleName()
Returns the simplified name of the type Example: StringMap<? extends TypeVariable<?>,? extends ClassType>
getTypeParams()
If this object represents a generic class, there are type parameters.boolean
isAbstract()
Determines if represented class is defined to be abstract.boolean
isAnnotationPresent(Class<? extends Annotation> annotationClass)
boolean
isAnonymousClass()
boolean
isArray()
Determines if object represents an array.boolean
isAssignableFrom(Class<?> typeR)
Determines if the given type is subtype of this.boolean
isAssignableFrom(ClassType typeR)
Determines if the given type is subtype of this.boolean
isBoolean()
Determines if object represents boolean or Boolean.boolean
isEnum()
Determines if object represents an enum type.boolean
isFinal()
Determines if represented class is defined to be final.boolean
isInstance(Object o)
boolean
isInteger()
Determines if object represents int, byte, short, long, Integer, Byte, Short or Long.boolean
isInterface()
Determines if represented type is interface type.boolean
isLocalClass()
boolean
isMemberClass()
boolean
isNumber()
Determines if object represents int, byte, short, long, float, double, Integer, Byte, Short, Long, Float or Double.boolean
isPrimitive()
Determines if object represents int, byte, short, long, float, double, char, boolean or void.boolean
isReal()
Determines if object represents float, double, Float or Double.
-
Method Details
-
getTypeParams
Map<? extends TypeVariable<?>,? extends ClassType> getTypeParams()If this object represents a generic class, there are type parameters.- Returns:
- type parameters
-
getName
String getName()Returns the name of the type Example: java.lang.String- Returns:
- name
- See Also:
Class.getName()
-
getDisplayName
String getDisplayName()Returns the displayed name of the type Example: java.lang.String[] instead of [java.lang.String;- Returns:
- name
- See Also:
Class.getName()
-
getSimpleName
String getSimpleName()Returns the simplified name of the type Example: String- Returns:
- simple name
- See Also:
Class.getSimpleName()
-
isAssignableFrom
Determines if the given type is subtype of this.- Parameters:
typeR
-- Returns:
- assignable
- See Also:
Class.isAssignableFrom(Class)
-
isAssignableFrom
Determines if the given type is subtype of this.- Parameters:
typeR
-- Returns:
- assignable
- See Also:
Class.isAssignableFrom(Class)
-
isPrimitive
boolean isPrimitive()Determines if object represents int, byte, short, long, float, double, char, boolean or void.- Returns:
- primitive?
- See Also:
Class.isPrimitive()
-
isNumber
boolean isNumber()Determines if object represents int, byte, short, long, float, double, Integer, Byte, Short, Long, Float or Double.- Returns:
- number?
-
isBoolean
boolean isBoolean()Determines if object represents boolean or Boolean.- Returns:
- boolean?
-
isInteger
boolean isInteger()Determines if object represents int, byte, short, long, Integer, Byte, Short or Long.- Returns:
- integer?
-
isReal
boolean isReal()Determines if object represents float, double, Float or Double.- Returns:
- real number?
-
isArray
boolean isArray()Determines if object represents an array.- Returns:
- array?
-
isEnum
boolean isEnum()Determines if object represents an enum type.- Returns:
- enum type?
-
isInterface
boolean isInterface()Determines if represented type is interface type.- Returns:
- interface?
- See Also:
Class.isInterface()
-
isAbstract
boolean isAbstract()Determines if represented class is defined to be abstract.- Returns:
- abstract?
-
isFinal
boolean isFinal()Determines if represented class is defined to be final.- Returns:
- final?
-
isMemberClass
boolean isMemberClass()- Returns:
- is member class?
- See Also:
Class.isMemberClass()
-
isAnonymousClass
boolean isAnonymousClass()- Returns:
- is anonymous class?
- See Also:
Class.isAnonymousClass()
-
isLocalClass
boolean isLocalClass()- Returns:
- is local class?
- See Also:
Class.isLocalClass()
-
getRawType
ClassType getRawType()- Returns:
- raw type
- See Also:
ParameterizedType.getRawType()
-
getParent
ClassType getParent()Returns the supertype of this object.- Returns:
- parent
-
isInstance
- Parameters:
o
- object- Returns:
- is object instance of class?
- See Also:
Class.isInstance(Object)
-
cast
- See Also:
Class.cast(java.lang.Object)
-
getClassHierarchy
Returns a list containing the complete class hierarchy from the parent class until java.lang.Object.- Returns:
- hierarchy
-
getAllInterfaces
Returns a list of all implemented interfaces inclusive all interfaces implemented by supertypes.- Returns:
- all interfaces
-
getDeclaringClass
ClassType getDeclaringClass()- Returns:
- declaring class
- See Also:
Class.getDeclaringClass()
-
getEnclosingClass
ClassType getEnclosingClass()- Returns:
- enclosing class
- See Also:
Class.getEnclosingClass()
-
getJavaType
Class<?> getJavaType()Returns the Java class represented by this instance- Returns:
- java class
-
isAnnotationPresent
- Parameters:
annotationClass
- the Class object corresponding to the annotation type- Returns:
- true if an annotation for the specified annotation type is present on this element, else false
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.isAnnotationPresent(Class)
-
getAnnotation
- Type Parameters:
T
- the type of the annotation to query for and return if present- Parameters:
annotationClass
- the Class object corresponding to the annotation type- Returns:
- this element's annotation for the specified annotation type if present on this element, else null
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.getAnnotation(Class)
-
getAnnotationsByType
- Parameters:
annotationClass
- the Class object corresponding to the annotation type- Returns:
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.getAnnotationsByType(Class)
-
getAnnotations
Annotation[] getAnnotations()- Returns:
- annotations present on this element
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.getAnnotations()
-
getDeclaredAnnotation
- Parameters:
annotationClass
- the Class object corresponding to the annotation type- Returns:
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.getDeclaredAnnotation(Class)
-
getDeclaredAnnotationsByType
- Parameters:
annotationClass
- the Class object corresponding to the annotation type- Returns:
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.getDeclaredAnnotationsByType(Class)
-
getDeclaredAnnotations
Annotation[] getDeclaredAnnotations()- Returns:
- Since:
- Omix 2.0
- See Also:
AnnotatedElement.getDeclaredAnnotations()
-