Class AbstractAttribute<X,Y>

java.lang.Object
cz.cvut.kbss.jopa.model.metamodel.AbstractAttribute<X,Y>
All Implemented Interfaces:
Attribute<X,Y>, FieldSpecification<X,Y>
Direct Known Subclasses:
AbstractPluralAttribute, SingularAttributeImpl

public abstract class AbstractAttribute<X,Y> extends Object implements Attribute<X,Y>
  • Method Details

    • getPersistentAttributeType

      public Attribute.PersistentAttributeType getPersistentAttributeType()
      Description copied from interface: Attribute
      Return the persistent attribute type for the attribute.
      Specified by:
      getPersistentAttributeType in interface Attribute<X,Y>
      Returns:
      persistent attribute type
    • getJavaMember

      public Member getJavaMember()
      Description copied from interface: Attribute
      Return the java.lang.reflect.Member for the represented attribute.
      Specified by:
      getJavaMember in interface Attribute<X,Y>
      Returns:
      corresponding java.lang.reflect.Member
    • getIRI

      public IRI getIRI()
      Description copied from interface: Attribute
      Returns the IRI identifier of the property mapped by this attribute.
      Specified by:
      getIRI in interface Attribute<X,Y>
      Returns:
      Property IRI
    • getCascadeTypes

      public CascadeType[] getCascadeTypes()
      Description copied from interface: Attribute
      Return the set of cascade types specified for this attribute.
      Specified by:
      getCascadeTypes in interface Attribute<X,Y>
      Returns:
      corresponding array of cascade types. This method returns an empty array if no cascade type is specified.
    • isNonEmpty

      public boolean isNonEmpty()
      Description copied from interface: Attribute
      Whether the attribute can be without value.

      Note that if Attribute.getConstraints() contains ParticipationConstraints, this property should be ignored.

      Specified by:
      isNonEmpty in interface Attribute<X,Y>
      Returns:
      boolean indicating whether the attribute can be empty
    • getConstraints

      public ParticipationConstraint[] getConstraints()
      Description copied from interface: Attribute
      Returns participation constraints specified for this attribute.
      Specified by:
      getConstraints in interface Attribute<X,Y>
      Returns:
      Array of participation constraints
    • getDeclaringType

      public ManagedType<X> getDeclaringType()
      Description copied from interface: FieldSpecification
      Return the managed type representing the type in which the attribute was declared.
      Specified by:
      getDeclaringType in interface FieldSpecification<X,Y>
      Returns:
      declaring type
    • getJavaField

      public Field getJavaField()
      Description copied from interface: FieldSpecification
      Return the java.lang.reflect.Member for the represented attribute.
      Specified by:
      getJavaField in interface FieldSpecification<X,Y>
      Returns:
      corresponding java.lang.reflect.Member
    • getFetchType

      public FetchType getFetchType()
      Description copied from interface: FieldSpecification
      Whether the association is lazily loaded or must be eagerly fetched.
      Specified by:
      getFetchType in interface FieldSpecification<X,Y>
      Returns:
      Fetch type of the field specification
    • isInferred

      public boolean isInferred()
      Description copied from interface: FieldSpecification
      Whether this field can contain inferred data.
      Specified by:
      isInferred in interface FieldSpecification<X,Y>
      Returns:
      Whether field is inferred
      See Also:
    • includeExplicit

      public boolean includeExplicit()
      Description copied from interface: FieldSpecification
      If this field is inferred, can it contain explicit data as well?
      Specified by:
      includeExplicit in interface FieldSpecification<X,Y>
      Returns:
      Whether inferred field can contain explicit knowledge
      See Also:
    • isLexicalForm

      public boolean isLexicalForm()
      Description copied from interface: Attribute
      Does the attribute contain values in lexical form.

      Applies only to datatype and annotation properties, object properties cannot be in lexical form.

      Specified by:
      isLexicalForm in interface Attribute<X,Y>
      Returns:
      Boolean indicating whether the attribute contains values in lexical form
    • isSimpleLiteral

      public boolean isSimpleLiteral()
      Description copied from interface: Attribute
      Does the attribute represent simple literals.

      Simple literals are stored as xsd:string, i.e., strings without language tag.

      Applies only to datatype and annotation properties, object properties cannot be simple literals.

      Specified by:
      isSimpleLiteral in interface Attribute<X,Y>
      Returns:
      Boolean indicating whether the attribute represents simple literals.
    • hasLanguage

      public boolean hasLanguage()
      Description copied from interface: Attribute
      Indicates whether a language is specified for this attribute.

      Note that language applies only to String-based data or annotation property attribute values, for which rdfs:langString values will be read and its language tag compared to the one required.

      Also note that if the attribute is a simple literal or in lexical form only, it has no language and this method will return false.

      Specified by:
      hasLanguage in interface Attribute<X,Y>
      Returns:
      Boolean indicating whether language is specified for this attribute
    • getLanguage

      public String getLanguage()
      Description copied from interface: Attribute
      Gets the language configured for this attribute.

      Note that language applies only to String-based data or annotation property attribute values, for which rdfs:langString values will be read and its language tag compared to the one required.

      If no language is specified directly for the attribute, persistence unit-level language setting is used.

      Specified by:
      getLanguage in interface Attribute<X,Y>
      Returns:
      Language configured for this attribute, null if none is set
      See Also:
    • getName

      public String getName()
      Description copied from interface: FieldSpecification
      Return the name of the attribute.
      Specified by:
      getName in interface FieldSpecification<X,Y>
      Returns:
      name
    • getConverter

      public ConverterWrapper getConverter()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDatatype

      public String getDatatype()
      Description copied from interface: Attribute
      Gets the explicitly specified identifier of the attribute datatype.

      Note that the returned value may be null in case the datatype is not explicitly specified and automatic datatype resolution provided by the underlying OntoDriver is used. null is also returned for object property attributes, as this does not apply to them.

      Specified by:
      getDatatype in interface Attribute<X,Y>
      Returns:
      Datatype identifier, possibly null