Package tigase.xml
Class ElementMatcher
java.lang.Object
tigase.xml.ElementMatcher
Class implements
Predicate for filtering Elements.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordClass holds attribute name and value to match againstElementusingElementMatcher -
Constructor Summary
ConstructorsConstructorDescriptionElementMatcher(@Nullable String name, @Nullable String xmlns, @Nullable List<ElementMatcher.Attribute> attributes) Constructor to create instance -
Method Summary
Modifier and TypeMethodDescription@NonNull ElementMatcheraddAttribute(@NonNull String name, @Nullable String value) Method add attribute to the matcherbooleaninthashCode()static @NonNull ElementMatcherMethod parsesStringinto matcherprotected static @NonNull ElementMatcherparse(@NonNull Path.State state) Method parsesStringinto matcher@NonNull ElementMatcherMethod sets matcher name to compare (or sets it to null to match any name)@NonNull ElementMatcherMethod sets matcher xmlns to compare (or sets it to null to match any xmlns)booleantoString()void
-
Constructor Details
-
ElementMatcher
public ElementMatcher() -
ElementMatcher
public ElementMatcher(@Nullable String name, @Nullable String xmlns, @Nullable List<ElementMatcher.Attribute> attributes) Constructor to create instance- Parameters:
name- - to match or nullxmlns- - to match or nullattributes- - to match or empty list
-
-
Method Details
-
parse
protected static @NonNull ElementMatcher parse(@NonNull Path.State state) throws Path.PathFormatException Method parsesStringinto matcher- Parameters:
state-- Returns:
- Throws:
Path.PathFormatException
-
parse
Method parsesStringinto matcher- Parameters:
text-- Returns:
- Throws:
Path.PathFormatException
-
setName
Method sets matcher name to compare (or sets it to null to match any name)- Parameters:
name-- Returns:
-
setXMLNS
Method sets matcher xmlns to compare (or sets it to null to match any xmlns)- Parameters:
xmlns-- Returns:
-
addAttribute
Method add attribute to the matcher- Parameters:
name- - attribute namevalue- - attribute value or null to accept any value- Returns:
-
test
-
equals
-
hashCode
public int hashCode() -
toString
-
toStringBuilder
-