Package org.apache.solr.common
Interface ConfigNode
public interface ConfigNode
A generic interface that represents a config file, mostly XML Please note that this is an
immutable, read-only object.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigNodeAn empty node object.static final ThreadLocal<Function<String, String>> -
Method Summary
Modifier and TypeMethodDescriptiondefault Stringdefault StringAttributes of this node.attributesExcept(String... exclusions) Mutable copy ofattributes(), excludingexclusionskeys.default StringattrRequired(String name, String missingErr) Likeattr(String)but throws an error (incorporatingmissingErr) if not found.default booleandefault booleanboolVal(boolean def) default ConfigNodeChild by namedefault ConfigNodechild(String name, Predicate<ConfigNode> test) Iterate through child nodes with the tag/element name and return the first matchingdefault ConfigNodechildRequired(String name, Supplier<RuntimeException> err) default doubledoubleVal(double def) default booleanexists()voidabortable iterate through childrendefault ConfigNodeChild by name or return an empty node if null.default ConfigNodedefault ConfigNodeget(String name, Predicate<ConfigNode> test) default List<ConfigNode> A list of all child nodes with the tag/element name.default List<ConfigNode> getAll(Set<String> names, Predicate<ConfigNode> test) Iterate through child nodes with the names and return all the matching childrendefault intdefault intintVal(int def) default booleanisNull()name()Name of the tag/element.txt()default String
-
Field Details
-
SUBSTITUTES
-
EMPTY
An empty node object. usually returned when the node is absent
-
-
Method Details
-
name
String name()Name of the tag/element. -
attributes
Attributes of this node. Immutable shared instance. Not null. -
attributesExcept
Mutable copy ofattributes(), excludingexclusionskeys. -
child
Child by name -
get
Child by name or return an empty node if null. If there are multiple values, it returns the first element. This never returns a null. -
get
-
get
-
childRequired
-
boolVal
default boolean boolVal(boolean def) -
intVal
default int intVal(int def) -
attr
-
attr
-
attrRequired
Likeattr(String)but throws an error (incorporatingmissingErr) if not found. -
intAttr
-
boolAttr
-
txt
-
txt
String txt() -
doubleVal
default double doubleVal(double def) -
child
Iterate through child nodes with the tag/element name and return the first matching -
getAll
Iterate through child nodes with the names and return all the matching children- Parameters:
names- names of tags/elements to be returned. Null means all nodes.test- check for the nodes to be returned. Null means all nodes.
-
getAll
A list of all child nodes with the tag/element name. -
exists
default boolean exists() -
isNull
default boolean isNull() -
forEachChild
abortable iterate through children- Parameters:
fun- consume the node and return true to continue or false to abort
-
childNodesToNamedList
-