Interface MetaClass

All Superinterfaces:
MetadataObject
All Known Implementing Classes:
KeyValueMetaClass, MetaClassImpl

public interface MetaClass extends MetadataObject
Metadata object representing an entity.
  • Method Details

    • getSession

      @Nullable Session getSession()
      Returns:
      containing MetaModel instance. Null signifies a temporary metaclass, not associated with an entity class.
    • getJavaClass

      <T> Class<T> getJavaClass()
      Returns:
      corresponding Java class
    • getAncestor

      @Nullable MetaClass getAncestor()
      Immediate ancestor of the object, or null if there is no one.
    • getAncestors

      List<MetaClass> getAncestors()
      All ancestors of the metaclass, in order going up from the immediate ancestor.
    • getDescendants

      Collection<MetaClass> getDescendants()
      All descendants of the metaclass, recursively. Order is undefined.
    • findProperty

      @Nullable MetaProperty findProperty(String name)
      Get MetaProperty by its name.
      Returns:
      MetaProperty instance, or null if no such property found
    • getProperty

      MetaProperty getProperty(String name)
      Get MetaProperty by its name.
      Returns:
      MetaProperty instance. Throws exception if not found.
    • getPropertyPath

      @Nullable MetaPropertyPath getPropertyPath(String propertyPath)
      Returns MetaPropertyPath object, representing path to the property from the current class Note that this method don't take into account extensions(e.g. Dynamic Attributes add-on) and it returns null in case of not static attributes(attributes from extension). For getting all attributes (including attributes from extensions) use MetadataTools.resolveMetaPropertyPath(MetaClass, String) or MetadataTools.resolveMetaPropertyPathOrNull(MetaClass, String) methods.
      Parameters:
      propertyPath - dot-separated string
      Returns:
      MetaPropertyPath instance, or null if the input parameter doesn't represent a valid path.
    • getOwnProperties

      Collection<MetaProperty> getOwnProperties()
      Returns:
      collection of meta properties directly owned by this metaclass.
    • getProperties

      Collection<MetaProperty> getProperties()
      Returns:
      collection of meta properties owned by this metaclass and all its ancestors.
    • getStore

      Store getStore()
      Returns:
      store of this entity