Class ObjectPropertyCollectionDescriptor
- All Implemented Interfaces:
Descriptor
-
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
ConstructorsModifierConstructorDescriptionObjectPropertyCollectionDescriptor
(FieldSpecification<?, ?> attribute) ObjectPropertyCollectionDescriptor
(URI context, FieldSpecification<?, ?> attribute) ObjectPropertyCollectionDescriptor
(URI context, FieldSpecification<?, ?> attribute, boolean assertionsInSubjectContext) protected
ObjectPropertyCollectionDescriptor
(Set<URI> contexts, boolean assertionsInSubjectContext, String language, boolean hasLanguage, boolean includeInferred, Field field, EntityDescriptor elementDescriptor) ObjectPropertyCollectionDescriptor
(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.addContext
(URI context) Adds the specified context to this descriptor.copy()
Creates a copy of this descriptor.protected boolean
equals
(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.int
hashCode()
protected int
boolean
Whether this descriptor overrides assertion context.unwrap()
Unwraps this descriptor if it wraps another descriptor (such as in the case of a collection descriptor).Methods inherited from class cz.cvut.kbss.jopa.model.descriptors.FieldDescriptor
getAttributeDescriptors, setAttributeLanguage
Methods inherited from class cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
anyLanguage, areAssertionsInSubjectContext, disableInference, enableInference, equals, equalsImpl, getContexts, getLanguage, getSingleAttributeContext, getSingleContext, hashCodeImpl, hasLanguage, includeInferred, setIncludeInferred, setLanguage, toString
-
Constructor Details
-
ObjectPropertyCollectionDescriptor
-
ObjectPropertyCollectionDescriptor
-
ObjectPropertyCollectionDescriptor
-
ObjectPropertyCollectionDescriptor
public ObjectPropertyCollectionDescriptor(URI context, FieldSpecification<?, ?> attribute, boolean assertionsInSubjectContext) -
ObjectPropertyCollectionDescriptor
protected ObjectPropertyCollectionDescriptor(Set<URI> contexts, boolean assertionsInSubjectContext, String language, boolean hasLanguage, boolean includeInferred, Field field, EntityDescriptor elementDescriptor)
-
-
Method Details
-
getAttributeDescriptor
Description copied from interface:Descriptor
Gets descriptor for the specified attribute.- Specified by:
getAttributeDescriptor
in interfaceDescriptor
- Overrides:
getAttributeDescriptor
in classFieldDescriptor
- Parameters:
attribute
- Entity attribute, as specified by the application metamodel- Returns:
- Descriptor
-
getAttributeContexts
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.
- Specified by:
getAttributeContexts
in interfaceDescriptor
- Overrides:
getAttributeContexts
in classFieldDescriptor
- Parameters:
attribute
- Entity attribute, as specified by the application model- Returns:
- Context identifiers
-
addAttributeDescriptor
public ObjectPropertyCollectionDescriptor 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.
- Specified by:
addAttributeDescriptor
in interfaceDescriptor
- Overrides:
addAttributeDescriptor
in classFieldDescriptor
- Parameters:
attribute
- The attribute to set descriptor fordescriptor
- The descriptor to use- Returns:
- This instance
-
addAttributeContext
public ObjectPropertyCollectionDescriptor 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.
- Specified by:
addAttributeContext
in interfaceDescriptor
- Overrides:
addAttributeContext
in classFieldDescriptor
- Parameters:
attribute
- The attribute to set context forcontext
- The context to set- Returns:
- This instance
- See Also:
-
addContext
Description copied from interface:Descriptor
Adds the specified context to this descriptor.Note that adding the default context removes all the previously added contexts, as they become obsolete.
- Specified by:
addContext
in interfaceDescriptor
- Overrides:
addContext
in classAbstractDescriptor
- Parameters:
context
- Context to add,null
indicates default context- 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.- Specified by:
overridesAssertionContext
in interfaceDescriptor
- Overrides:
overridesAssertionContext
in classFieldDescriptor
- Returns:
- Boolean indicating whether assertion context is based on object descriptor
- See Also:
-
unwrap
Description copied from interface:Descriptor
Unwraps this descriptor if it wraps another descriptor (such as in the case of a collection descriptor).If there is nothing to unwrap, the descriptor returns itself.
- Returns:
- Unwrapped descriptor
-
copy
Description copied from interface:Descriptor
Creates a copy of this descriptor.- Specified by:
copy
in interfaceDescriptor
- Overrides:
copy
in classFieldDescriptor
- Returns:
- New descriptor with identical values
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractDescriptor
-
equals
- Overrides:
equals
in classFieldDescriptor
-
hashCode
- Overrides:
hashCode
in classFieldDescriptor
-