Class AbstractDescriptor
- All Implemented Interfaces:
- Descriptor
- Direct Known Subclasses:
- EntityDescriptor,- FieldDescriptor
The descriptor hierarchy is a classical Composite pattern.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final boolean
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedprotectedAbstractDescriptor(boolean assertionsInSubjectContext) protectedAbstractDescriptor(URI context) protectedAbstractDescriptor(URI context, boolean assertionsInSubjectContext) protectedAbstractDescriptor(Set<URI> contexts, boolean assertionsInSubjectContext, String language, boolean hasLanguage, boolean includeInferred) 
- 
Method SummaryModifier and TypeMethodDescriptionaddContext(URI context) Adds the specified context to this descriptor.Configures this descriptor to support any language tag (including no language tags).booleanWhether property assertion should be stored in the subject's context (default), or whether they should be stored together with the assertion value.Instructs this descriptor to specify that only asserted statements should be loaded for otherwise inferred attributes.Instructs this descriptor to specify that both inferred and asserted statements should be loaded for otherwise inferred attributes.booleanprotected booleanequals(Object other, Map<AbstractDescriptor.VisitedPair, Boolean> visited) protected booleanequalsImpl(Object o) Gets contexts for this descriptor.Gets the language set for this descriptor.getSingleAttributeContext(FieldSpecification<?, ?> attribute) Gets the only context specified by this descriptor for the specified attribute.Gets the only context specified by this descriptor.inthashCode()protected intprotected intbooleanGets information about whether language tag has been set on this descriptor.booleanWhether to include inferred statements when loading data corresponding to this descriptor.protected voidsetIncludeInferred(boolean includeInferred) setLanguage(String languageTag) Sets language tag of this descriptor.toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface cz.cvut.kbss.jopa.model.descriptors.DescriptoraddAttributeContext, addAttributeDescriptor, copy, getAttributeContexts, getAttributeDescriptor, getAttributeDescriptors, overridesAssertionContext, setAttributeLanguage, unwrap
- 
Field Details- 
contexts
- 
assertionsInSubjectContextprotected final boolean assertionsInSubjectContext
 
- 
- 
Constructor Details- 
AbstractDescriptorprotected AbstractDescriptor()
- 
AbstractDescriptorprotected AbstractDescriptor(boolean assertionsInSubjectContext) 
- 
AbstractDescriptor
- 
AbstractDescriptor
- 
AbstractDescriptor
 
- 
- 
Method Details- 
getContextsDescription copied from interface:DescriptorGets contexts for this descriptor.An empty result indicates the default context. Note that for saving, there must be at most one context. - Specified by:
- getContextsin interface- Descriptor
- Returns:
- Context URIs
 
- 
getSingleContextDescription copied from interface:DescriptorGets the only context specified by this descriptor.This method will check whether there is at most one context specified in this descriptor. If there are none (meaning the default should be used), an empty Optionalis returned. If there are more than one, anAmbiguousContextExceptionis thrown.This method is intended to be used by data modification operations, which require at most one target context to be specified. - Specified by:
- getSingleContextin interface- Descriptor
- Returns:
- Single entity context wrapped in Optional, empty, if there is none
 
- 
addContextDescription copied from interface:DescriptorAdds the specified context to this descriptor.Note that adding the default context removes all the previously added contexts, as they become obsolete. - Specified by:
- addContextin interface- Descriptor
- Parameters:
- context- Context to add,- nullindicates default context
- Returns:
- This instance
 
- 
getSingleAttributeContextDescription copied from interface:DescriptorGets the only context specified by this descriptor for the specified attribute.If no context is specified (meaning the default context should be used), an empty Optionalis returned.If more than one context are available for the specified attribute, an AmbiguousContextExceptionis thrown.- Specified by:
- getSingleAttributeContextin interface- Descriptor
- Parameters:
- attribute- Entity attribute, as specified by the application model
- Returns:
- Context identifier
- See Also:
 
- 
getLanguageDescription copied from interface:DescriptorGets the language set for this descriptor.- Specified by:
- getLanguagein interface- Descriptor
- Returns:
- Language tag (e.g. en, cs), can be null, meaning any language is supported or the language tag has not been set (seeDescriptor.hasLanguage())
 
- 
hasLanguagepublic boolean hasLanguage()Description copied from interface:DescriptorGets information about whether language tag has been set on this descriptor.The language tag can be explicitly set to null, meaning any language is supported. This can be used to override PU-level language setting.- Specified by:
- hasLanguagein interface- Descriptor
- Returns:
- trueif a language tag has been set on this descriptor,- falseotherwise
 
- 
setLanguageDescription copied from interface:DescriptorSets language tag of this descriptor.Applies to any possible sub-descriptors as well. - Specified by:
- setLanguagein interface- Descriptor
- Parameters:
- languageTag- The language tag to use, possibly- null, meaning no language preference should be used
- Returns:
- This instance
- See Also:
 
- 
anyLanguageDescription copied from interface:DescriptorConfigures this descriptor to support any language tag (including no language tags).This is useful for overriding previously set language tag expectations (either on PU level or parent descriptor level). This does the same as calling Descriptor.setLanguage(String)withnullargument, but is more explicit.- Specified by:
- anyLanguagein interface- Descriptor
- Returns:
- This instance
 
- 
areAssertionsInSubjectContextpublic boolean areAssertionsInSubjectContext()Description copied from interface:DescriptorWhether property assertion should be stored in the subject's context (default), or whether they should be stored together with the assertion value.This applies to object references, literal values are always stored in the specified context. - Specified by:
- areAssertionsInSubjectContextin interface- Descriptor
- Returns:
- Whether property assertion is stored in the subject context
 
- 
includeInferredpublic boolean includeInferred()Description copied from interface:DescriptorWhether to include inferred statements when loading data corresponding to this descriptor.Note that this setting is taken into account only for attributes that are declared as possibly containing inferred values (using the Inferredannotation). For explicit attributes, this setting is ignored.The setting in this descriptor is applied recursively to all the descriptors it may be composed of, unless a different value is specified explicitly for them. - Specified by:
- includeInferredin interface- Descriptor
- Returns:
- Whether to include inferred values for inferred attributes
- See Also:
 
- 
disableInferenceDescription copied from interface:DescriptorInstructs this descriptor to specify that only asserted statements should be loaded for otherwise inferred attributes.- Specified by:
- disableInferencein interface- Descriptor
- Returns:
- This descriptor
- See Also:
 
- 
enableInferenceDescription copied from interface:DescriptorInstructs this descriptor to specify that both inferred and asserted statements should be loaded for otherwise inferred attributes.This is the default setting. - Specified by:
- enableInferencein interface- Descriptor
- Returns:
- This descriptor
- See Also:
 
- 
setIncludeInferredprotected void setIncludeInferred(boolean includeInferred) 
- 
equals
- 
equalsImpl
- 
equals
- 
hashCodepublic int hashCode()
- 
hashCodeImplprotected int hashCodeImpl()
- 
hashCode
- 
toString
 
-