Class ContextRoot
java.lang.Object
pro.verron.officestamper.core.ContextRoot
- All Implemented Interfaces:
ContextTree
The root of the context tree.
-
Constructor Summary
ConstructorsConstructorDescriptionContextRoot(Object root) Constructs a ContextRoot with the given root object. -
Method Summary
Modifier and TypeMethodDescriptionAdds a new branch to the context tree with the specified sub-context object.addBranch(ContextBranch contextBranch) Adds a branch to the root.Finds a branch by its key.
-
Constructor Details
-
ContextRoot
Constructs a ContextRoot with the given root object.- Parameters:
root- the root object.
-
-
Method Details
-
find
Finds a branch by its key.- Parameters:
key- the key of the branch.- Returns:
- the branch, or
nullif not found.
-
addBranch
Description copied from interface:ContextTreeAdds 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:
addBranchin interfaceContextTree- 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
Adds a branch to the root.- Parameters:
contextBranch- the branch to add.- Returns:
- the key of the added branch.
-