Class FieldDescriptor
- All Implemented Interfaces:
Descriptor
- Direct Known Subclasses:
ObjectPropertyCollectionDescriptor
-
Nested Class Summary
Nested classes/interfaces inherited from class cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
AbstractDescriptor.VisitedPair -
Field Summary
Fields inherited from class cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
assertionsInSubjectContext, contexts -
Constructor Summary
ConstructorsModifierConstructorDescriptionFieldDescriptor(FieldSpecification<?, ?> attribute) FieldDescriptor(URI context, FieldSpecification<?, ?> attribute) protectedFieldDescriptor(Set<URI> contexts, boolean assertionsInSubjectContext, String language, boolean hasLanguage, boolean includeInferred, Field field) FieldDescriptor(Set<URI> contexts, FieldSpecification<?, ?> attribute) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeContext(FieldSpecification<?, ?> attribute, URI context) Adds repository context for the specified attribute.addAttributeDescriptor(FieldSpecification<?, ?> attribute, Descriptor descriptor) Adds descriptor for the specified attribute.copy()Creates a copy of this descriptor.protected booleanequals(Object other, Map<AbstractDescriptor.VisitedPair, Boolean> visited) getAttributeContexts(FieldSpecification<?, ?> attribute) Gets contexts in which the property assertion(s) of the specified attribute are stored.getAttributeDescriptor(FieldSpecification<?, ?> attribute) Gets descriptor for the specified attribute.Gets attribute descriptors specified in this descriptor.protected intbooleanWhether this descriptor overrides assertion context.setAttributeLanguage(FieldSpecification<?, ?> attribute, String languageTag) UseAbstractDescriptor.setLanguage(String)instead.Methods inherited from class cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
addContext, anyLanguage, areAssertionsInSubjectContext, disableInference, enableInference, equals, equalsImpl, getContexts, getLanguage, getSingleAttributeContext, getSingleContext, hashCode, hashCodeImpl, hasLanguage, includeInferred, setIncludeInferred, setLanguage, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface cz.cvut.kbss.jopa.model.descriptors.Descriptor
unwrap
-
Constructor Details
-
FieldDescriptor
-
FieldDescriptor
-
FieldDescriptor
-
FieldDescriptor
-
-
Method Details
-
getAttributeDescriptors
Description copied from interface:DescriptorGets attribute descriptors specified in this descriptor.- Returns:
- Unmodifiable view of attribute descriptors
-
getAttributeDescriptor
Description copied from interface:DescriptorGets descriptor for the specified attribute.- Parameters:
attribute- Entity attribute, as specified by the application metamodel- Returns:
- Descriptor
-
getAttributeContexts
Description copied from interface:DescriptorGets 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:DescriptorAdds 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 fordescriptor- The descriptor to use- Returns:
- This instance
-
addAttributeContext
Description copied from interface:DescriptorAdds 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 forcontext- The context to set- Returns:
- This instance
- See Also:
-
setAttributeLanguage
UseAbstractDescriptor.setLanguage(String)instead.- Parameters:
attribute- The attribute concernedlanguageTag- Language tag to use, possiblynull- Returns:
- This instance
-
overridesAssertionContext
public boolean overridesAssertionContext()Description copied from interface:DescriptorWhether 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
Description copied from interface:DescriptorCreates a copy of this descriptor.- Returns:
- New descriptor with identical values
-
equals
- Overrides:
equalsin classAbstractDescriptor
-
hashCode
- Overrides:
hashCodein classAbstractDescriptor
-