Class MutableNode
java.lang.Object
ch.nolix.base.document.node.AbstractNode<MutableNode>
ch.nolix.base.document.node.AbstractMutableNode<MutableNode>
ch.nolix.base.document.node.MutableNode
- All Implemented Interfaces:
IFluentMutableOptionalHeaderHolder<MutableNode>, IOptionalHeaderHolder, IMutableNode<MutableNode>, INode<MutableNode>, Resettable, BlanknessRequestable
- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from class AbstractNode
CLOSED_BRACKET_CODE, COMMA_CODE, DOLLAR_SYMBOL_CODE, OPEN_BRACKET_CODE -
Method Summary
Modifier and TypeMethodDescriptionaddChildNode(INode<?> childNode) Adds the given childNode to the currentIMutableNode.addChildNodes(INode<?>... childNodes) Adds the given childNodes to the currentIMutableNode.<N extends INode<?>>
MutableNodeaddChildNodes(Iterable<N> pChildNodes) Adds the given childNodes to the currentIMutableNode.addChildNodesFromStrings(Iterable<String> strings) Adds the childINodes from the given strings the currentIMutableNode.addChildNodesFromStrings(String... strings) Adds the childINodes from the given strings to the currentIMutableNode.INode<?> asWithHeader(String header) static MutableNodestatic MutableNodestatic MutableNodestatic MutableNodefromString(String string) booleanremoveAndGetStoredFirstChildNodeThat(Predicate<INode<?>> selector) Removes and returns the first childINodethe given selector selects from the currentIMutableNode.voidRemoves the childINodes from the currentIMutableNode.voidremoveFirstChildNodeThat(Predicate<INode<?>> selector) Removes the first childINodethe given selector selects from the currentIMutableNode.voidremoveFirstChildNodeWithHeader(String header) Removes the first childINodewith the given header from the currentIMutableNode.voidRemoves the header of currentIFluentMutableOptionalHeaderHolder.voidreplaceFirstChildNodeWithGivenHeaderByGivenNode(String header, INode<?> childNode) Replaces the first childINodewith the given header from the currentIMutableNodeby the givenINode.voidreset()Resets the currentResettable.Sets the header of the currentIFluentMutableOptionalHeaderHolder.Methods inherited from class AbstractMutableNode
addPostfixToHeader, addPrefixToHeader, resetFromFile, resetFromNode, resetFromString, setChildNodesMethods inherited from class AbstractNode
containsChildNodes, containsChildNodeThat, containsChildNodeWithHeader, containsOneChildNode, equals, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getEscapeStringFor, getOptionalStoredFirstChildNodeThat, getOriginStringFromEscapeString, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodesThat, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNodeThat, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, hashCode, isBlank, saveToFile, saveToFile, toBoolean, toDouble, toFormattedString, toInt, toString, toXmlMethods inherited from interface BlanknessRequestable
isBlankMethods inherited from interface INode
containsChildNodes, containsChildNodeThat, containsChildNodeWithHeader, containsOneChildNode, getChildNodeCount, getChildNodeCount, getChildNodesHeaders, getOptionalStoredFirstChildNodeThat, getSingleChildNodeAsBoolean, getSingleChildNodeAsDouble, getSingleChildNodeAsInt, getSingleChildNodeHeader, getStoredChildNodeAtOneBasedIndex, getStoredChildNodesThat, getStoredChildNodesWithHeader, getStoredFirstChildNode, getStoredFirstChildNodeThat, getStoredFirstChildNodeWithHeader, getStoredSingleChildNode, toBoolean, toDouble, toFormattedString, toInt, toXmlMethods inherited from interface IOptionalHeaderHolder
getHeaderOrEmptyString, getOptionalHeader, hasHeader
-
Method Details
-
createEmpty
- Returns:
- a new empty
MutableNode.
-
fromFile
- Parameters:
filePath-- Returns:
- a new
MutableNodefrom the file with the given filePath. - Throws:
RuntimeException- if the given filePath is not valid.RuntimeException- if the file with the given filePath does not represent aMutableNode.
-
fromNode
- Parameters:
node-- Returns:
- a new
MutableNodefrom the givenINode.
-
fromString
- Parameters:
string-- Returns:
- a new
MutableNodefrom the given string. - Throws:
RuntimeException- if the given string does not represent aMutableNode.
-
addChildNode
Adds the given childNode to the currentIMutableNode.- Parameters:
childNode-- Returns:
- the current
IMutableNode.
-
addChildNodes
Adds the given childNodes to the currentIMutableNode.- Parameters:
childNodes-- Returns:
- the current
IMutableNode.
-
addChildNodes
Adds the given childNodes to the currentIMutableNode.- Type Parameters:
N- is the type of the given childNodes.- Parameters:
pChildNodes-- Returns:
- the current
IMutableNode.
-
addChildNodesFromStrings
Adds the childINodes from the given strings the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode.
-
addChildNodesFromStrings
Adds the childINodes from the given strings to the currentIMutableNode.- Parameters:
strings-- Returns:
- the current
IMutableNode.
-
asWithHeader
-
getStoredChildNodes
-
getHeader
- Returns:
- the header of the current
IOptionalHeaderHolder.
-
hasHeader
public boolean hasHeader()- Returns:
- true if the current
IOptionalHeaderHolderhas a header, false otherwise.
-
removeChildNodes
public void removeChildNodes()Removes the childINodes from the currentIMutableNode. -
removeAndGetStoredFirstChildNodeThat
Removes and returns the first childINodethe given selector selects from the currentIMutableNode.- Parameters:
selector-- Returns:
- the first child
INodethe given selector selects from the currentIMutableNode.
-
removeFirstChildNodeThat
Removes the first childINodethe given selector selects from the currentIMutableNode.- Parameters:
selector-
-
removeFirstChildNodeWithHeader
Removes the first childINodewith the given header from the currentIMutableNode.- Parameters:
header-
-
removeHeader
public void removeHeader()Removes the header of currentIFluentMutableOptionalHeaderHolder. -
replaceFirstChildNodeWithGivenHeaderByGivenNode
Replaces the first childINodewith the given header from the currentIMutableNodeby the givenINode.- Parameters:
header-childNode-
-
reset
public void reset()Resets the currentResettable. -
setHeader
Sets the header of the currentIFluentMutableOptionalHeaderHolder.- Parameters:
header-- Returns:
- the current
IFluentMutableOptionalHeaderHolder.
-