Class EntityDescriptor
java.lang.Object
cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
cz.cvut.kbss.jopa.model.descriptors.EntityDescriptor
- All Implemented Interfaces:
Descriptor
Describes an entity.
Each attribute has a descriptor associated with it.
-
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
ConstructorsModifierConstructorDescriptionEntityDescriptor(boolean assertionsInSubjectContext) Allows configuring where object property assertions should be storedEntityDescriptor(URI context) EntityDescriptor(URI context, boolean assertionsInSubjectContext) EntityDescriptor(Set<URI> contexts) protectedEntityDescriptor(Set<URI> contexts, boolean assertionsInSubjectContext, String language, boolean hasLanguage, boolean includeInferred, Map<Field, Descriptor> fieldDescriptors) -
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.booleanprotected 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.inthashCode()protected intsetAttributeLanguage(FieldSpecification<?, ?> attribute, String languageTag) Sets language to be used when working (retrieving, persisting) with values of the specified attribute.setLanguage(String languageTag) Sets language tag of this descriptor.Methods inherited from class cz.cvut.kbss.jopa.model.descriptors.AbstractDescriptor
addContext, anyLanguage, areAssertionsInSubjectContext, disableInference, enableInference, equalsImpl, getContexts, getLanguage, getSingleAttributeContext, getSingleContext, hashCodeImpl, hasLanguage, includeInferred, setIncludeInferred, 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
overridesAssertionContext, unwrap
-
Constructor Details
-
EntityDescriptor
public EntityDescriptor() -
EntityDescriptor
public EntityDescriptor(boolean assertionsInSubjectContext) Allows configuring where object property assertions should be stored- Parameters:
assertionsInSubjectContext- Whether object property assertions are stored in the subject's. Defaults totrue. Iffalse, object property assertions are stored in the object's context- See Also:
-
EntityDescriptor
-
EntityDescriptor
-
EntityDescriptor
-
EntityDescriptor
-
-
Method Details
-
addAttributeDescriptor
public EntityDescriptor 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:
-
setLanguage
Description copied from interface:DescriptorSets language tag of this descriptor.Applies to any possible sub-descriptors as well.
- Specified by:
setLanguagein interfaceDescriptor- Overrides:
setLanguagein classAbstractDescriptor- Parameters:
languageTag- The language tag to use, possiblynull, meaning no language preference should be used- Returns:
- This instance
- See Also:
-
setAttributeLanguage
Description copied from interface:DescriptorSets language to be used when working (retrieving, persisting) with values of the specified attribute.Note that setting language in this manner will not have any effect on descriptors of the specified attribute previously retrieved from this descriptor.
- Parameters:
attribute- The attribute concernedlanguageTag- Language tag to use, possiblynull- Returns:
- This instance
-
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
-
getAttributeDescriptors
Description copied from interface:DescriptorGets attribute descriptors specified in this descriptor.- Returns:
- Unmodifiable view of attribute descriptors
-
copy
Description copied from interface:DescriptorCreates a copy of this descriptor.- Returns:
- New descriptor with identical values
-
equals
- Overrides:
equalsin classAbstractDescriptor
-
equals
- Overrides:
equalsin classAbstractDescriptor
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractDescriptor
-
hashCode
- Overrides:
hashCodein classAbstractDescriptor
-