Interface Attribute<X,Y>

Type Parameters:
X - The represented type that contains the attribute
Y - The type of the represented attribute
All Superinterfaces:
FieldSpecification<X,Y>
All Known Subinterfaces:
CollectionAttribute<X,E>, ListAttribute<X,E>, MapAttribute<X,K,V>, PluralAttribute<X,C,E>, RDFContainerAttribute<X,C,E>, SetAttribute<X,E>, SingularAttribute<X,T>
All Known Implementing Classes:
AbstractAttribute, AbstractPluralAttribute, CollectionAttributeImpl, ListAttributeImpl, RDFCollectionAttribute, RdfContainerAttributeImpl, SetAttributeImpl, SingularAttributeImpl

public interface Attribute<X,Y> extends FieldSpecification<X,Y>
Represents an attribute of a Java type.
  • Method Details

    • getPersistentAttributeType

      Attribute.PersistentAttributeType getPersistentAttributeType()
      Return the persistent attribute type for the attribute.
      Returns:
      persistent attribute type
    • getJavaMember

      Member getJavaMember()
      Return the java.lang.reflect.Member for the represented attribute.
      Returns:
      corresponding java.lang.reflect.Member
    • getIRI

      IRI getIRI()
      Returns the IRI identifier of the property mapped by this attribute.
      Returns:
      Property IRI
    • getCascadeTypes

      CascadeType[] getCascadeTypes()
      Return the set of cascade types specified for this attribute.
      Returns:
      corresponding array of cascade types. This method returns an empty array if no cascade type is specified.
      Throws:
      IllegalArgumentException - if getPersistentAttributeType() returns DATA or ANNOTATION.
    • isAssociation

      default boolean isAssociation()
      Is the attribute an association.
      Returns:
      boolean indicating whether the attribute corresponds to an association
    • isNonEmpty

      boolean isNonEmpty()
      Whether the attribute can be without value.

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

      Returns:
      boolean indicating whether the attribute can be empty
    • isLexicalForm

      boolean isLexicalForm()
      Does the attribute contain values in lexical form.

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

      Returns:
      Boolean indicating whether the attribute contains values in lexical form
    • getDatatype

      String getDatatype()
      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.

      Returns:
      Datatype identifier, possibly null
    • isSimpleLiteral

      boolean isSimpleLiteral()
      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.

      Returns:
      Boolean indicating whether the attribute represents simple literals.
    • hasLanguage

      boolean hasLanguage()
      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.

      Returns:
      Boolean indicating whether language is specified for this attribute
    • getLanguage

      String getLanguage()
      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.

      Returns:
      Language configured for this attribute, null if none is set
      See Also:
    • getConstraints

      ParticipationConstraint[] getConstraints()
      Returns participation constraints specified for this attribute.
      Returns:
      Array of participation constraints
    • isMappedAttribute

      default boolean isMappedAttribute()
      Description copied from interface: FieldSpecification
      Whether the attribute is mapped to an ontological property.
      Specified by:
      isMappedAttribute in interface FieldSpecification<X,Y>
      Returns:
      true if the attribute is mapped to an ontological property, false otherwise