Class RootNode
- java.lang.Object
-
- com.github.mizool.core.configuration.RootNode
-
- All Implemented Interfaces:
HasChildren
public final class RootNode extends Object implements HasChildren
The root node of a set of properties.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RootNode
add(InputStream inputStream, Charset charset)
Creates a new root node that incorporates the current node's properties and the ones loaded from the given input stream.RootNode
add(Reader reader)
Creates a new root node that incorporates the current node's properties and the ones loaded from the given reader.PropertyNode
child(String key)
Returns the childPropertyNode
with the given name.String
toString()
-
-
-
Method Detail
-
child
public PropertyNode child(String key)
Description copied from interface:HasChildren
Returns the childPropertyNode
with the given name. Until a value is retrieved, no check is made for the existence of any property.
Example: For a node representingtimeouts.network
, callingchild("connect")
will return a node representingtimeouts.network.connect
.- Specified by:
child
in interfaceHasChildren
- Parameters:
key
- one or more segments of the key to append to the key of the current node- Returns:
- the child or descendant node, never
null
.
-
add
public RootNode add(Reader reader)
Creates a new root node that incorporates the current node's properties and the ones loaded from the given reader.- Parameters:
reader
- the reader to load from
-
add
public RootNode add(InputStream inputStream, Charset charset)
Creates a new root node that incorporates the current node's properties and the ones loaded from the given input stream.
Note that unlikeProperties.load(InputStream)
, this method will not use ISO 8859-1 (the classic encoding of properties files) unless specified.- Parameters:
inputStream
- the input stream to load fromcharset
- the charset to use
-
-