public interface ConfigInheritance
extends java.io.Serializable
Modifier and Type | Interface and Description |
---|---|
static interface |
ConfigInheritance.ConfigInheritanceContext
marker interface for inheritance contexts, for keys which can define one or more inheritance patterns;
implementers can define their own, e.g.
|
static class |
ConfigInheritance.InheritanceMode
Deprecated.
since 0.10.0 see implementations of this interface
|
static class |
ConfigInheritance.Legacy
Deprecated.
since 0.10.0 see implementations of this interface
|
Modifier and Type | Field and Description |
---|---|
static ConfigInheritance |
ALWAYS
Deprecated.
since 0.10.0 see implementations of this interface
|
static ConfigInheritance |
DEEP_MERGE
Deprecated.
since 0.10.0 see implementations of this interface
|
static ConfigInheritance |
NONE
Deprecated.
since 0.10.0 see implementations of this interface
|
Modifier and Type | Method and Description |
---|---|
<TContainer,TValue> |
considerParent(ConfigValueAtContainer<TContainer,TValue> local,
ConfigValueAtContainer<TContainer,TValue> parent,
ConfigInheritance.ConfigInheritanceContext context)
Returns whether any value from the parent or its ancestors should be considered
by the given local container, according to the
ConfigInheritance defined there. |
ConfigInheritance.InheritanceMode |
isInherited(ConfigKey<?> key,
java.lang.Object from,
java.lang.Object to)
Deprecated.
since 0.10.0 more complex inheritance conditions now require other methods
|
<TContainer,TValue> |
isReinheritable(ConfigValueAtContainer<TContainer,TValue> parent,
ConfigInheritance.ConfigInheritanceContext context)
Returns whether any value from the given node or ancestors can be considered
for inheritance by descendants, according to the
ConfigInheritance defined there. |
<TContainer,TValue> |
resolveWithParent(ConfigValueAtContainer<TContainer,TValue> local,
ConfigValueAtContainer<TContainer,TValue> resolvedParent,
ConfigInheritance.ConfigInheritanceContext context)
Returns the result after inheritance between the local container and a "resolveParent"
representation of the parent's evaluation of the key considering its ancestors.
|
@Deprecated static final ConfigInheritance NONE
@Deprecated static final ConfigInheritance ALWAYS
@Deprecated static final ConfigInheritance DEEP_MERGE
@Deprecated ConfigInheritance.InheritanceMode isInherited(ConfigKey<?> key, java.lang.Object from, java.lang.Object to)
<TContainer,TValue> boolean isReinheritable(@Nullable ConfigValueAtContainer<TContainer,TValue> parent, ConfigInheritance.ConfigInheritanceContext context)
ConfigInheritance
defined there.
Implementations should not normally consider the value here
as there may be other ancestors whose values have not yet been considered and are not supplied.
If there is a ConfigInheritance
defined at this node,
this method must be called on that instance and that instance only.
In that case it is an error to invoke this method on any other ConfigInheritance
instance.
If there is not one, the config generally should be considered reinheritable;
callers will typically not invoke this method from a descendant inheritance context.
Consumers will typically find the methods in ConfigInheritances
more convenient.
<TContainer,TValue> boolean considerParent(@Nonnull ConfigValueAtContainer<TContainer,TValue> local, @Nullable ConfigValueAtContainer<TContainer,TValue> parent, ConfigInheritance.ConfigInheritanceContext context)
ConfigInheritance
defined there.
This defines the ConfigInheritance
of the local container typically considering
the value of the key there.
Implementations should not normally consider the value of the parent
as there may be other ancestors whose values have not yet been considered and are not supplied,
but it may determine that a local value is sufficient to render it unnecessary to consider the parent.
If there is a ConfigInheritance
defined at the local container,
this method must be called on that instance and that instance only.
In that case it is an error to invoke this method on any other ConfigInheritance
instance.
Consumers should consider this in conjuction with the
isReinheritable(ConfigValueAtContainer, ConfigInheritanceContext)
status of the parent (if present).
Implementers need not duplicate a call to that method.
Consumers will typically find the methods in ConfigInheritances
more convenient.
<TContainer,TValue> ReferenceWithError<ConfigValueAtContainer<TContainer,TValue>> resolveWithParent(@Nonnull ConfigValueAtContainer<TContainer,TValue> local, @Nonnull ConfigValueAtContainer<TContainer,TValue> resolvedParent, ConfigInheritance.ConfigInheritanceContext context)
considerParent(ConfigValueAtContainer, ConfigValueAtContainer, ConfigInheritanceContext)
on the local node and isReinheritable(ConfigValueAtContainer, ConfigInheritanceContext)
on the original parent node,
and then resolveWithParent(ConfigValueAtContainer, ConfigValueAtContainer, ConfigInheritanceContext)
on the original parent node with its respective resolvedParent.
If there is a ConfigInheritance
defined at the local container,
this method must be called on that instance and that instance only.
In that case it is an error to invoke this method on any other ConfigInheritance
instance.
Consumers will typically find the methods in ConfigInheritances
more convenient.