Package com.evolveum.midpoint.prism
Class PrismNamespaceContext
java.lang.Object
com.evolveum.midpoint.prism.PrismNamespaceContext
- All Implemented Interfaces:
- Serializable
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic enum
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final PrismNamespaceContext.PrefixPreferencestatic final Stringstatic final PrismNamespaceContextstatic final PrismNamespaceContext
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuilder()abstract PrismNamespaceContext.Builderabstract PrismNamespaceContextchildContext(Map<String, String> local) Creates child namespace context with supplied local mappingchildDefaultNamespace(String namespace) static PrismNamespaceContextabstract PrismNamespaceContextReturns child namespace context with no local mappings.abstract booleanabstract booleanisEmpty()abstract booleanReturns true if context is only inherited and not explicitly defined.abstract booleanReturn true, if context is empty on local level (no mappings defined, or context is inherited) Note: This is useful for context serialization - if context is empty, it should not be serializedReturns mapping of locally defined prefixes to namespaces Returns mapping of prefixes to namespaces defined in this namespace context.namespaceFor(String prefix) Returns namespace for specified prefix.static PrismNamespaceContextabstract PrismNamespaceContextoptimizedChildContext(Map<String, String> local) Creates optimized child namespace context with supplied local mappingabstract Optional<PrismNamespaceContext>parent()Returns parent namespace contextLook up suitable prefix for namespace using default prefix search preference-prefixFor(String namespace, PrismNamespaceContext.PrefixPreference preference) Look up suitable prefix for namespace using provided preference.abstract PrismNamespaceContextrebasedOn(PrismNamespaceContext current) toString()@NotNull PrismNamespaceContext
- 
Field Details- 
EMPTY
- 
DEFAULT_PREFIX- See Also:
 
- 
DEFAULT_PREFERENCE
- 
PRISM_API
 
- 
- 
Constructor Details- 
PrismNamespaceContextpublic PrismNamespaceContext()
 
- 
- 
Method Details- 
from
- 
builder
- 
parentReturns parent namespace context- Returns:
- parent namespace context
 
- 
localPrefixesReturns mapping of locally defined prefixes to namespaces Returns mapping of prefixes to namespaces defined in this namespace context. Note that mappings of parent namespaces context also apply, unless the prefix is overridden at current level.- Returns:
- mapping of locally defined prefixes to namespaces
 
- 
allPrefixes
- 
isInheritedpublic abstract boolean isInherited()Returns true if context is only inherited and not explicitly defined.- Returns:
- True if context is inherited, false if context is explicitly defined.
 
- 
isLocalEmptypublic abstract boolean isLocalEmpty()Return true, if context is empty on local level (no mappings defined, or context is inherited) Note: This is useful for context serialization - if context is empty, it should not be serialized- Returns:
- True if context does not define local mappings.
 
- 
isEmptypublic abstract boolean isEmpty()
- 
isDefaultNamespaceOnlypublic abstract boolean isDefaultNamespaceOnly()
- 
namespaceForReturns namespace for specified prefix. If prefix is not defined at current context, parent contexts are lookup up for prefix.- Returns:
- Empty, if no namespace was found, otherwise namespace assigned to supplied prefix.
 
- 
defaultNamespace
- 
prefixForLook up suitable prefix for namespace using default prefix search preference-- Parameters:
- namespace- Namespace for which prefix should be returned.
- Returns:
- Prefix which is mapped to namespace.
 
- 
prefixForpublic abstract Optional<String> prefixFor(String namespace, PrismNamespaceContext.PrefixPreference preference) Look up suitable prefix for namespace using provided preference.- Parameters:
- namespace- Namespace for which prefix should be returned.
- preference- Preference (top-most or closest prefix) which should be returned.
- Returns:
- Prefix which is mapped to namespace.
 
- 
childContextCreates child namespace context with supplied local mapping- Parameters:
- local- Local definition of prefixes
- Returns:
- Child context with local definitions
 
- 
optimizedChildContextCreates optimized child namespace context with supplied local mapping- Parameters:
- local- Local definition of prefixes
- Returns:
- Child context with local definitions
 
- 
inheritedReturns child namespace context with no local mappings. Implementation Note: Implementation ensures that instances of inherited context are reused (eg.context.inherited() == context.inherited()andcontext.inherited() == context.inherited().inherited())- Returns:
- child namespace context with no local mappings.
 
- 
of
- 
childDefaultNamespace
- 
rebasedOn
- 
withoutDefault
- 
toString
- 
childBuilder
 
-