Enum NodeNameMatchers
- java.lang.Object
-
- java.lang.Enum<NodeNameMatchers>
-
- org.apache.commons.configuration2.tree.NodeNameMatchers
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NodeNameMatchers>
,NodeMatcher<java.lang.String>
public enum NodeNameMatchers extends java.lang.Enum<NodeNameMatchers> implements NodeMatcher<java.lang.String>
An enumeration class with several pre-defined
NodeMatcher
implementations based on node names.Filtering nodes by their name is a typical use case. Therefore, some default implementations for typical filter algorithms are already provided. They are available as constants of this class. Because the algorithms are state-less these instances can be shared and accessed concurrently.
- Since:
- 2.0
- Version:
- $Id: NodeNameMatchers.java 1636050 2014-11-01 20:59:08Z oheger $
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EQUALS
A matcher for exact node name matches.EQUALS_IGNORE_CASE
A matcher for matches on node names which ignores case.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeNameMatchers
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static NodeNameMatchers[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.apache.commons.configuration2.tree.NodeMatcher
matches
-
-
-
-
Enum Constant Detail
-
EQUALS
public static final NodeNameMatchers EQUALS
A matcher for exact node name matches. This matcher returns true if and only if the name of the passed in node equals exactly the given criterion string.
-
EQUALS_IGNORE_CASE
public static final NodeNameMatchers EQUALS_IGNORE_CASE
A matcher for matches on node names which ignores case. For this matcher the namesnode
,NODE
, orNodE
are all the same.
-
-
Method Detail
-
values
public static NodeNameMatchers[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NodeNameMatchers c : NodeNameMatchers.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NodeNameMatchers valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-