-
- All Known Implementing Classes:
ConfigNodeManager
public interface ConfigNodeServiceHolds and manages config nodes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GResultOf<ConfigNode>addNode(ConfigNodeContainer newNode)Add a new node, if a root already exists merge the nodes.GResultOf<ConfigNode>navigateToNextNode(java.lang.String path, java.util.List<Token> tokens, ConfigNode currentNode)From a given node navigate to the next node.GResultOf<ConfigNode>navigateToNextNode(java.lang.String path, Token token, ConfigNode currentNode)From a given node navigate to the next node.GResultOf<ConfigNode>navigateToNode(java.lang.String path, java.util.List<Token> tokens, Tags tags)navigate to a node for a path from the root.GResultOf<java.lang.Boolean>postProcess(java.util.List<PostProcessor> postProcessors)Apply a list of Post Processors on the root node.GResultOf<ConfigNode>reloadNode(ConfigNodeContainer reloadNode)Reload a node, if there are more than one node it will merge it into the config tree in the same order as the existing node.
-
-
-
Method Detail
-
addNode
GResultOf<ConfigNode> addNode(ConfigNodeContainer newNode) throws GestaltException
Add a new node, if a root already exists merge the nodes. When adding a node and merging, the new node always takes precedence.- Parameters:
newNode- node to be added- Returns:
- newly merged node
- Throws:
GestaltException- any exceptions
-
postProcess
GResultOf<java.lang.Boolean> postProcess(java.util.List<PostProcessor> postProcessors) throws GestaltException
Apply a list of Post Processors on the root node. This allows a post processor to modify the config tree in any way. It will navigate to each node in the tree and pass it to the post processor. The post processors are run in order of priority, with the next post processor getting the results from the previous. The post processor returns a node that is then used to replace the current node.- Parameters:
postProcessors- list of post processors to apply.- Returns:
- if the post process has completed successfully
- Throws:
GestaltException- any exceptions
-
reloadNode
GResultOf<ConfigNode> reloadNode(ConfigNodeContainer reloadNode) throws GestaltException
Reload a node, if there are more than one node it will merge it into the config tree in the same order as the existing node. The container node has an ID so we can identity and know which node to reload to preserve order.- Parameters:
reloadNode- node to reload.- Returns:
- the new root node
- Throws:
GestaltException- any exceptions
-
navigateToNode
GResultOf<ConfigNode> navigateToNode(java.lang.String path, java.util.List<Token> tokens, Tags tags)
navigate to a node for a path from the root.- Parameters:
path- to navigate totokens- list of tokens to navigate to.tags- list of tags to match- Returns:
- GResultOf node or any errors.
-
navigateToNextNode
GResultOf<ConfigNode> navigateToNextNode(java.lang.String path, Token token, ConfigNode currentNode)
From a given node navigate to the next node. If an ArrayToken and the config node is an ArrayNode it will return the next node by index. If a ObjectToken and the config node is a MapNode it will return the next node by key.- Parameters:
path- to here for logging.token- token for the next nodecurrentNode- current node we want to navigate from- Returns:
- GResultOf node or any errors.
-
navigateToNextNode
GResultOf<ConfigNode> navigateToNextNode(java.lang.String path, java.util.List<Token> tokens, ConfigNode currentNode)
From a given node navigate to the next node.- Parameters:
path- to here for logging.tokens- list of token for the next nodecurrentNode- current node we want to navigate from- Returns:
- GResultOf node or any errors.
-
-