Class ManagedClassProcessor

java.lang.Object
cz.cvut.kbss.jopa.model.metamodel.ManagedClassProcessor

public class ManagedClassProcessor extends Object
Utility methods for processing managed types for metamodel construction.
  • Method Details

    • detectNamespaces

      public static <T> void detectNamespaces(Class<T> cls, NamespaceResolver namespaceResolver)
      Detects namespace declarations relevant to the specified class and registers them with the specified NamespaceResolver.

      This means namespaces declared on the class itself, namespaces it inherited from super types, as well as namespaces declared for the package that contains the specified class.

      Namespaces declared directly by Namespace as well as in Namespaces are considered.

      Parameters:
      cls - Class to detect namespaces for
      namespaceResolver - Namespace resolver containing detected namespaces
    • isManagedType

      public static boolean isManagedType(Class<?> cls)
      Checks whether the specified class is a managed type.

      That is, if it is an entity type (annotated with OWLClass) or a mapped superclass (annotated with MappedSuperclass).

      Parameters:
      cls - Class to check
      Returns:
      true if the class is a managed type, false otherwise
    • isEntityType

      public static boolean isEntityType(Class<?> cls)
      Checks whether the specified class is an entity type.

      An entity is annotated with OWLClass.

      Parameters:
      cls - Class to check
      Returns:
      true if the class is an entity type, false otherwise
    • isMappedSuperclassType

      public static boolean isMappedSuperclassType(Class<?> cls)
      Checks whether the specified class is a managed superclass.

      An entity is annotated with MappedSuperclass.

      Parameters:
      cls - Class to check
      Returns:
      true if the class is a mapped superclass, false otherwise