Class ResourceSchemaImpl

All Implemented Interfaces:
Serializable, Element, EntityElement, IdentifiableElement, EntitySchema, ResourceSchema, Type

public final class ResourceSchemaImpl extends EntitySchemaImpl implements ResourceSchema
The default implementation of the ResourceSchema interface.

A Resource holds no property of its own, so properties is not a member of its definition: it is never written, and it is skipped when a representation carries it.

Author:
Luca Frosini (ISTI - CNR)
See Also:
  • Field Details

    • consistsOf

      protected List<LinkedEntity> consistsOf
      The ConsistsOf constraints of the resource type, empty when it declares none.
    • isRelatedTo

      protected List<LinkedEntity> isRelatedTo
      The IsRelatedTo constraints of the resource type, empty when it declares none.
  • Constructor Details

    • ResourceSchemaImpl

      protected ResourceSchemaImpl()
      Default constructor.
    • ResourceSchemaImpl

      public ResourceSchemaImpl(String name)
      Constructs a new ResourceSchemaImpl with the given type name.
      Parameters:
      name - The type name.
    • ResourceSchemaImpl

      public ResourceSchemaImpl(Class<? extends Resource> clz)
      Constructs a new ResourceSchemaImpl from a class.
      Parameters:
      clz - The class.
  • Method Details

    • getConsistsOf

      public List<LinkedEntity> getConsistsOf()
      Returns the list of ConsistsOf constraints (target Facet types) associated with this resource type.
      Specified by:
      getConsistsOf in interface ResourceSchema
      Returns:
      A list of LinkedEntity objects representing the ConsistsOf constraints.
    • getIsRelatedTo

      public List<LinkedEntity> getIsRelatedTo()
      Returns the list of IsRelatedTo constraints (related resource types) for this resource type.
      Specified by:
      getIsRelatedTo in interface ResourceSchema
      Returns:
      A list of LinkedEntity objects representing the IsRelatedTo constraints.
    • getProperties

      public List<PropertyDefinition> getProperties()
      Gets the properties of the type.
      Specified by:
      getProperties in interface ResourceSchema
      Specified by:
      getProperties in interface Type
      Overrides:
      getProperties in class TypeImpl
      Returns:
      always null: a Resource type declares no property.
    • setConsistsOf

      protected void setConsistsOf(List<LinkedEntity> consistsOf)
      Sets the ConsistsOf constraints; a null list means none.
      Parameters:
      consistsOf - The constraints.
    • setIsRelatedTo

      protected void setIsRelatedTo(List<LinkedEntity> isRelatedTo)
      Sets the IsRelatedTo constraints; a null list means none.
      Parameters:
      isRelatedTo - The constraints.
    • getAccessType

      public AccessType getAccessType()
      Returns the AccessType of this type definition.
      Specified by:
      getAccessType in interface Type
      Overrides:
      getAccessType in class EntitySchemaImpl
      Returns:
      The access type.