Class ContextRoot

java.lang.Object
pro.verron.officestamper.core.ContextRoot
All Implemented Interfaces:
ContextTree

public class ContextRoot extends Object implements ContextTree
The root of the context tree.
  • Constructor Details

    • ContextRoot

      public ContextRoot(Object root)
      Constructs a ContextRoot with the given root object.
      Parameters:
      root - the root object.
  • Method Details

    • find

      public ContextBranch find(String key)
      Finds a branch by its key.
      Parameters:
      key - the key of the branch.
      Returns:
      the branch, or null if not found.
    • addBranch

      public String addBranch(Object subContext)
      Description copied from interface: ContextTree
      Adds a new branch to the context tree with the specified sub-context object. The new branch will have the current branch as its parent.
      Specified by:
      addBranch in interface ContextTree
      Parameters:
      subContext - the object to be added as a new branch in the context tree
      Returns:
      a unique identifier (key) for the newly created branch
    • addBranch

      public String addBranch(ContextBranch contextBranch)
      Adds a branch to the root.
      Parameters:
      contextBranch - the branch to add.
      Returns:
      the key of the added branch.