Interface Attribute<X,Y>
- Type Parameters:
X
- The represented type that contains the attributeY
- 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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturn the set of cascade types specified for this attribute.Returns participation constraints specified for this attribute.Gets the explicitly specified identifier of the attribute datatype.getIRI()
Returns theIRI
identifier of the property mapped by this attribute.Return the java.lang.reflect.Member for the represented attribute.Gets the language configured for this attribute.Return the persistent attribute type for the attribute.boolean
Indicates whether a language is specified for this attribute.default boolean
Is the attribute an association.boolean
Does the attribute contain values in lexical form.default boolean
Whether the attribute is mapped to an ontological property.boolean
Whether the attribute can be without value.boolean
Does the attribute represent simple literals.Methods inherited from interface cz.cvut.kbss.jopa.model.metamodel.FieldSpecification
getDeclaringType, getFetchType, getJavaField, getJavaType, getName, includeExplicit, isCollection, isInferred
-
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 theIRI
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()
containsParticipationConstraint
s, 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 interfaceFieldSpecification<X,
Y> - Returns:
true
if the attribute is mapped to an ontological property,false
otherwise
-