Package com.evolveum.midpoint.prism
Class PrismNamespaceContext
java.lang.Object
com.evolveum.midpoint.prism.PrismNamespaceContext
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PrismNamespaceContext.PrefixPreference
static final String
static final PrismNamespaceContext
static final PrismNamespaceContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
abstract PrismNamespaceContext.Builder
abstract PrismNamespaceContext
childContext
(Map<String, String> local) Creates child namespace context with supplied local mappingchildDefaultNamespace
(String namespace) static PrismNamespaceContext
abstract PrismNamespaceContext
Returns child namespace context with no local mappings.abstract boolean
abstract boolean
isEmpty()
abstract boolean
Returns true if context is only inherited and not explicitly defined.abstract boolean
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 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 PrismNamespaceContext
abstract PrismNamespaceContext
optimizedChildContext
(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 PrismNamespaceContext
rebasedOn
(PrismNamespaceContext current) toString()
@NotNull PrismNamespaceContext
-
Field Details
-
EMPTY
-
DEFAULT_PREFIX
- See Also:
-
DEFAULT_PREFERENCE
-
PRISM_API
-
-
Constructor Details
-
PrismNamespaceContext
public PrismNamespaceContext()
-
-
Method Details
-
from
-
builder
-
parent
Returns parent namespace context- Returns:
- parent namespace context
-
localPrefixes
Returns 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
-
isInherited
public 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.
-
isLocalEmpty
public 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.
-
isEmpty
public abstract boolean isEmpty() -
isDefaultNamespaceOnly
public abstract boolean isDefaultNamespaceOnly() -
namespaceFor
Returns 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
-
prefixFor
Look 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.
-
prefixFor
public 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.
-
childContext
Creates child namespace context with supplied local mapping- Parameters:
local
- Local definition of prefixes- Returns:
- Child context with local definitions
-
optimizedChildContext
Creates optimized child namespace context with supplied local mapping- Parameters:
local
- Local definition of prefixes- Returns:
- Child context with local definitions
-
inherited
Returns 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
-