Class FieldDescriptor

java.lang.Object
cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
cz.cvut.kbss.jopa.model.descriptors.FieldDescriptor
All Implemented Interfaces:
Descriptor
Direct Known Subclasses:
ObjectPropertyCollectionDescriptor

public class FieldDescriptor extends AbstractDescriptor
Describes a singular data property or a plural data, object or annotation property field.
  • Constructor Details

    • FieldDescriptor

      public FieldDescriptor(FieldSpecification<?,?> attribute)
    • FieldDescriptor

      public FieldDescriptor(URI context, FieldSpecification<?,?> attribute)
    • FieldDescriptor

      public FieldDescriptor(Set<URI> contexts, FieldSpecification<?,?> attribute)
    • FieldDescriptor

      protected FieldDescriptor(Set<URI> contexts, boolean assertionsInSubjectContext, String language, boolean hasLanguage, boolean includeInferred, Field field)
  • Method Details

    • getAttributeDescriptors

      public Collection<Descriptor> getAttributeDescriptors()
      Description copied from interface: Descriptor
      Gets attribute descriptors specified in this descriptor.
      Returns:
      Unmodifiable view of attribute descriptors
    • getAttributeDescriptor

      public Descriptor getAttributeDescriptor(FieldSpecification<?,?> attribute)
      Description copied from interface: Descriptor
      Gets descriptor for the specified attribute.
      Parameters:
      attribute - Entity attribute, as specified by the application metamodel
      Returns:
      Descriptor
    • getAttributeContexts

      public Set<URI> getAttributeContexts(FieldSpecification<?,?> attribute)
      Description copied from interface: Descriptor
      Gets contexts in which the property assertion(s) of the specified attribute are stored.

      If none are specified for the attribute, contexts of this descriptor are returned.

      Note that for saving a property assertion, there must be at most one context.

      Parameters:
      attribute - Entity attribute, as specified by the application model
      Returns:
      Context identifiers
    • addAttributeDescriptor

      public FieldDescriptor addAttributeDescriptor(FieldSpecification<?,?> attribute, Descriptor descriptor)
      Description copied from interface: Descriptor
      Adds descriptor for the specified attribute.

      If a descriptor already exists for the specified attribute, it is overridden by the new one.

      Parameters:
      attribute - The attribute to set descriptor for
      descriptor - The descriptor to use
      Returns:
      This instance
    • addAttributeContext

      public FieldDescriptor addAttributeContext(FieldSpecification<?,?> attribute, URI context)
      Description copied from interface: Descriptor
      Adds repository context for the specified attribute.

      This in effect means creating a descriptor (if it does not already exist) for the specified field and adding the specified context to it.

      Parameters:
      attribute - The attribute to set context for
      context - The context to set
      Returns:
      This instance
      See Also:
    • setAttributeLanguage

      public FieldDescriptor setAttributeLanguage(FieldSpecification<?,?> attribute, String languageTag)
      Parameters:
      attribute - The attribute concerned
      languageTag - Language tag to use, possibly null
      Returns:
      This instance
    • overridesAssertionContext

      public boolean overridesAssertionContext()
      Description copied from interface: Descriptor
      Whether this descriptor overrides assertion context.

      Assertions are typically stored in the subject context, even if their target is in a different context (see Descriptor.areAssertionsInSubjectContext()). However, literal values have to be stored in the assertion context only, so descriptors of fields holding literal values can override the default assertion target context to use the field descriptor context for assertion as well.

      Returns:
      Boolean indicating whether assertion context is based on object descriptor
      See Also:
    • copy

      public FieldDescriptor copy()
      Description copied from interface: Descriptor
      Creates a copy of this descriptor.
      Returns:
      New descriptor with identical values
    • equals

      protected boolean equals(Object other, Map<AbstractDescriptor.VisitedPair,Boolean> visited)
      Overrides:
      equals in class AbstractDescriptor
    • hashCode

      protected int hashCode(Map<Object,Boolean> visited)
      Overrides:
      hashCode in class AbstractDescriptor