Class NotifyingTreeNestingContext

java.lang.Object
org.hibernate.search.engine.common.tree.impl.NotifyingTreeNestingContext
All Implemented Interfaces:
TreeNestingContext

public final class NotifyingTreeNestingContext extends Object implements TreeNestingContext
  • Constructor Details

  • Method Details

    • nest

      public <T> T nest(String relativeName, TreeNestingContext.LeafFactory<T> factory)
      Description copied from interface: TreeNestingContext
      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.

      Specified by:
      nest in interface TreeNestingContext
      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

      public <T> T nest(String relativeName, TreeNestingContext.CompositeFactory<T> factory)
      Description copied from interface: TreeNestingContext
      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.

      Specified by:
      nest in interface TreeNestingContext
      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

      public <T> T nestUnfiltered(TreeNestingContext.UnfilteredFactory<T> factory)
      Description copied from interface: TreeNestingContext
      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.

      Specified by:
      nestUnfiltered in interface TreeNestingContext
      Type Parameters:
      T - The type of the created nodes.
      Parameters:
      factory - The element factory to use.
      Returns:
      The created nodes.
    • nestComposed

      public <T> Optional<T> nestComposed(MappingElement mappingElement, String relativePrefix, TreeFilterDefinition definition, TreeFilterPathTracker pathTracker, TreeNestingContext.NestedContextBuilder<T> contextBuilder, BiFunction<MappingElement,String,SearchException> cyclicRecursionExceptionFactory)
      Description copied from interface: TreeNestingContext
      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().

      Specified by:
      nestComposed in interface TreeNestingContext
      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 to MappingElement.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.