Module omix.api

Interface ClassType


public interface ClassType
Represents a type in OVL and Java.
Since:
Omix 1.3.11
Author:
Dr. Peter Droste, Omix Visualization
  • 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

      boolean isInstance​(Object o)
      Parameters:
      o - object
      Returns:
      is object instance of class?
    • cast

      Object cast​(Object o)
    • getClassHierarchy

      List<? extends ClassType> getClassHierarchy()
      Returns a list containing the complete class hierarchy from the parent class until java.lang.Object.
      Returns:
      hierarchy
    • getAllInterfaces

      List<? extends ClassType> 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

      boolean isAssignableFrom​(ClassType typeR)
      Determines if the given type is subtype of this.
      Parameters:
      typeR -
      Returns:
      assignable
    • isAnnotationPresent

      boolean isAnnotationPresent​(Class<? extends Annotation> annotationClass)
      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

      <A extends Annotation> A getAnnotation​(Class<A> annotationClass)
      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

      <T extends Annotation> T[] getAnnotationsByType​(Class<T> annotationClass)
      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

      <A extends Annotation> A getDeclaredAnnotation​(Class<A> annotationClass)
      Parameters:
      annotationClass - the Class object corresponding to the annotation type
      Returns:
      Since:
      Omix 2.0
      See Also:
      AnnotatedElement.getDeclaredAnnotation(Class)
    • getDeclaredAnnotationsByType

      <T extends Annotation> T[] getDeclaredAnnotationsByType​(Class<T> annotationClass)
      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()