Interface IPrototype

All Superinterfaces:
IAdaptable, IChangeListener, IHasCustomValues, IHasValues, IPObject

public interface IPrototype extends IPObject
  • Field Details

  • Method Details

    • getName

      String getName()
      Returns:
      The prototype name.
    • getLabel

      @NotNull String getLabel()
      Returns:
      The prototype (localized) label.
      Since:
      3.8.1
    • getSupertypes

      Collection getSupertypes()
      Returns:
      List of IPrototypes which are direct supertypes of this one.
    • isEachInstanceReadOnly

      boolean isEachInstanceReadOnly()
      Returns:
      True if the whole prototype (each instance of it) is read only.
    • allowsCustomFields

      boolean allowsCustomFields()
      Returns:
      True, if instances of this type can have custom fields, false otherwise. The ability to have custom fields is inheritable.
    • getKeyNames

      Collection getKeyNames()
      Returns:
      Collection of String names of keys defined by the prototype. This includes the keys defined on supertypes. Never returns null.
    • getNonInheritedKeyNames

      Collection getNonInheritedKeyNames()
      Returns:
      Collection of String names of keys defined by this prototype. This excludes the keys defined on supertypes. Never returns null.
    • isKeyNonInherited

      boolean isKeyNonInherited(String key)
      Returns:
      True If the given key exists in this prototype and is NOT inherited from the supertype.
    • getPrototypeDefiningKey

      IPrototype getPrototypeDefiningKey(String key)
      Parameters:
      key -
      Returns:
      Returns the prototype that the given key is originally defined in. In other words, it returns a prototype where isKeyNonInherited(key) returns true.
      See Also:
    • getKeyType

      IType getKeyType(String key)
      This method also handles composed keys to create a single destination for logic implementation. (Composed keys lead to lists or structures, like key.struct_key.LIST)
      Parameters:
      key -
      Returns:
      The key type, or null if the key is not defined by this or any other supertype.
    • isKeyDefined

      boolean isKeyDefined(String key)
      Returns:
      TrueIf the given key exists in this prototype (or a supertype). Otherwise False.
    • isKeyRequired

      boolean isKeyRequired(String key)
      Parameters:
      key -
      Returns:
      True If the given key exists in this prototype (or some of the supertypes) AND is marked as required. False otherwise.
    • isKeyReadOnly

      boolean isKeyReadOnly(String key)
      The implementation of IPObject should ensure, that read-only keys can be set.
      Parameters:
      key -
      Returns:
      True If IPObject.isReadOnly() returns true, or the given key exists in this prototype. (or some of the supertypes) AND is marked as read-only. False otherwise.
    • getPrimaryKey

      String getPrimaryKey()
    • isPrimaryKey

      boolean isPrimaryKey(String key)
    • canKeyBeCached

      boolean canKeyBeCached(String key)
      Since:
      3.5.2
    • isVersioned

      boolean isVersioned()
      Returns:
      whether instances of this prototype can be versioned
      Since:
      3.6.0
    • getAnotationKeys

      @Deprecated Collection getAnotationKeys()
      Deprecated.
      use getAnnotationKeys() with the same behavior
      Returns:
      Collection of Strings
    • getAnnotationKeys

      Collection getAnnotationKeys()
      The annotations are meant to provide additional information about the prototype. They can be used, for example, to register renderers.
      Returns:
      Collection of Strings
      Since:
      3.1.2
    • getAnnotationValues

      Collection getAnnotationValues(String key)
      Returns:
      the Collection of @link Objects or an empty Collection for unknown keys. It never returns null
    • getAnnotationValue

      String getAnnotationValue(String key)
      Use this method if you expect the annotation to only have a single value.

      If there are multiple values, then an error is logged and the first value is returned.

      Returns:
      The annotation value or null none are found.