public interface ConfigNode
Modifier and Type | Interface and Description |
---|---|
static class |
ConfigNode.Helpers |
Modifier and Type | Field and Description |
---|---|
static ConfigNode |
EMPTY
An empty node object.
|
static SimpleMap<String> |
empty_attrs |
static ThreadLocal<Function<String,String>> |
SUBSTITUTES |
Modifier and Type | Method and Description |
---|---|
default String |
attr(String name) |
default String |
attr(String name,
String def) |
SimpleMap<String> |
attributes()
Attributes
|
default boolean |
boolAttr(String name,
boolean def) |
default boolean |
boolVal(boolean def) |
default ConfigNode |
child(List<String> path) |
default ConfigNode |
child(Predicate<ConfigNode> test,
String name)
Iterate through child nodes with the name and return the first child that matches
|
default ConfigNode |
child(String name)
Child by name
|
default ConfigNode |
child(String name,
Supplier<RuntimeException> err) |
default double |
doubleVal(double def) |
default boolean |
exists() |
void |
forEachChild(Function<ConfigNode,Boolean> fun)
abortable iterate through children
|
default ConfigNode |
get(String name)
Child by name or return an empty node if null
if there are multiple values , it returns the first elem
This never returns a null
|
default ConfigNode |
get(String name,
int idx) |
default ConfigNode |
get(String name,
Predicate<ConfigNode> test) |
default List<ConfigNode> |
getAll(Predicate<ConfigNode> test,
Set<String> matchNames)
Iterate through child nodes with the names and return all the matching children
|
default List<ConfigNode> |
getAll(Predicate<ConfigNode> test,
String... nodeNames)
Iterate through child nodes with the names and return all the matching children
|
default List<ConfigNode> |
getAll(String name) |
default int |
intAttr(String name,
int def) |
default int |
intVal(int def) |
default boolean |
isNull() |
String |
name()
Name of the tag
|
default String |
requiredStrAttr(String name,
Supplier<RuntimeException> err) |
String |
txt() |
default String |
txt(String def) |
static final ThreadLocal<Function<String,String>> SUBSTITUTES
static final ConfigNode EMPTY
String name()
default ConfigNode child(String name)
default ConfigNode get(String name)
default ConfigNode get(String name, Predicate<ConfigNode> test)
default ConfigNode get(String name, int idx)
default ConfigNode child(List<String> path)
default ConfigNode child(String name, Supplier<RuntimeException> err)
default boolean boolVal(boolean def)
default int intVal(int def)
default String requiredStrAttr(String name, Supplier<RuntimeException> err)
default int intAttr(String name, int def)
default boolean boolAttr(String name, boolean def)
String txt()
default double doubleVal(double def)
default ConfigNode child(Predicate<ConfigNode> test, String name)
default List<ConfigNode> getAll(Predicate<ConfigNode> test, String... nodeNames)
nodeNames
- names of tags to be returnedtest
- check for the nodes to be returneddefault List<ConfigNode> getAll(Predicate<ConfigNode> test, Set<String> matchNames)
matchNames
- names of tags to be returnedtest
- check for the nodes to be returneddefault List<ConfigNode> getAll(String name)
default boolean exists()
default boolean isNull()
void forEachChild(Function<ConfigNode,Boolean> fun)
fun
- consume the node and return true to continue or false to abortCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.