Interface TreeNestingContext
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionstatic TreeNestingContext
<T> T
nest
(String relativeName, TreeNestingContext.CompositeFactory<T> factory) Nest a composite node in this context.<T> T
nest
(String relativeName, TreeNestingContext.LeafFactory<T> factory) Nest a leaf node in this context.<T> Optional<T>
nestComposed
(MappingElement mappingElement, String relativePrefix, TreeFilterDefinition definition, TreeFilterPathTracker pathTracker, TreeNestingContext.NestedContextBuilder<T> contextBuilder, BiFunction<MappingElement, String, SearchException> cyclicRecursionExceptionFactory) Creates a nested context within this context, composing the given filter within this context's filter.<T> T
nestUnfiltered
(TreeNestingContext.UnfilteredFactory<T> factory) Nest an unfiltered node in this context.static TreeNestingContext
notifying
(TreeNestingContext delegate, TreeContributionListener listener) static TreeNestingContext
root()
-
Method Details
-
nest
Nest a leaf node in this context.The schema element will be created using the given factory, passing the
TreeNodeInclusion
to signal whether it's included or not.The name passed to the factory will still be relative and still won't contain any dot ("."), but may be prefixed as required by this context's configuration.
- Type Parameters:
T
- The type of the created node.- Parameters:
relativeName
- The base of the relative field name, which may get prefixed before it is passed to the factory.factory
- The element factory to use.- Returns:
- The created node.
-
nest
Nest a composite node in this context.The node will be created using the given factory, passing the
TreeNodeInclusion
to signal whether it's included or not.The name passed to the factory will still be relative and still won't contain any dot ("."), but may be prefixed as required by this context's configuration.
- Type Parameters:
T
- The type of the created node.- Parameters:
relativeName
- The base of the relative field name, which may get prefixed before it is passed to the factory.factory
- The element factory to use.- Returns:
- The created node.
-
nestUnfiltered
Nest an unfiltered node in this context.The node will be created using the given factory, passing the
TreeNodeInclusion
to signal whether it's included or not.Unfiltered nodes do not take inclusion filters into account; they are included as soon as their parent is included.
- Type Parameters:
T
- The type of the created nodes.- Parameters:
factory
- The element factory to use.- Returns:
- The created nodes.
-
nestComposed
<T> Optional<T> nestComposed(MappingElement mappingElement, String relativePrefix, TreeFilterDefinition definition, TreeFilterPathTracker pathTracker, TreeNestingContext.NestedContextBuilder<T> contextBuilder, BiFunction<MappingElement, String, SearchException> cyclicRecursionExceptionFactory) Creates a nested context within this context, composing the given filter within this context's filter.The node will be created using the given
builder
.If the resulting context excludes everything, this method returns
Optional.empty()
.- Type Parameters:
T
- The type of the created context.- Parameters:
mappingElement
- A unique representation of the mapping element defining the filter; if the same mapping is applied in multiple places, this method must be called with mapping elements that are equal according toMappingElement.equals(Object)
/MappingElement.hashCode()
.relativePrefix
- The prefix to prepend to the relative path of all nodes nested in the resulting context.definition
- The filter definition (included paths, ...).pathTracker
- The path tracker, for detection of useless filters.contextBuilder
- The builder for the created context.cyclicRecursionExceptionFactory
- A factory for exceptions thrown when encountering cyclic (infinite) filter recursions.- Returns:
- The created context.
-
root
-
notifying
- Parameters:
delegate
- The nesting context to wrap.listener
- The listener to notify when nodes are contributed through the returned context.- Returns:
- A context that notifies the given listener when nodes are contributed to (included in) it.
-
excludeAll
- Returns:
- A nesting context that always excludes all elements and does not prefix the field names.
-