public interface ClassType
Represents a type in OVL and Java.
- Since:
- Omix 1.3.11
- Author:
- Dr. Peter Droste, Omix Visualization
-
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[]ClassType
getEnclosingClass()
String
getName()
Returns the name of the type Example: java.lang.StringClassType
getParent()
Returns the supertype of this object.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(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
-
getDisplayName
String getDisplayName()Returns the displayed name of the type Example: java.lang.String[]- Returns:
- name
-
getSimpleName
String getSimpleName()Returns the simplified name of the type Example: String- Returns:
- simple name
-
isPrimitive
boolean isPrimitive()Determines if object represents int, byte, short, long, float, double, char, boolean or void.- Returns:
- primitive?
-
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?
-
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?
-
isAnonymousClass
boolean isAnonymousClass()- Returns:
- is anonymous class?
-
isLocalClass
boolean isLocalClass()- Returns:
- is local class?
-
getParent
ClassType getParent()Returns the supertype of this object.- Returns:
- parent
-
isInstance
- Parameters:
o
- object- Returns:
- is object instance of class?
-
cast
-
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
-
getEnclosingClass
ClassType getEnclosingClass()- Returns:
- enclosing class
-
isAssignableFrom
Determines if the given type is subtype of this.- Parameters:
typeR
-- Returns:
- assignable
-
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()
-