Package tigase.xml

Class Path

java.lang.Object
tigase.xml.Path

public class Path extends Object
Path holds predicates that need to be matched to find child (element within a tree of elements).
  • Method Details

    • parse

      public static @NonNull Path parse(@NonNull String text) throws Path.PathFormatException
      Method parses String into path
      Parameters:
      text -
      Returns:
      Throws:
      Path.PathFormatException
    • of

      public static @NonNull Path of(@NonNull String... matcherStrings) throws Path.PathFormatException
      Simplified for to ease transition from String[] to Path.
      Parameters:
      matcherStrings -
      Returns:
      Throws:
      Path.PathFormatException
    • of

      public static @NonNull Path of(@NonNull ElementMatcher... matchers)
      Method for creating Path from ElementMatchers. Each matcher is responsible for filtering nodes at one level of the elements tree.
      Parameters:
      matchers -
      Returns:
    • nameAndXmlns

      public static @NonNull Path nameAndXmlns(@NonNull String name, @NonNull String xmlns)
    • evaluate

      public @Nullable Element evaluate(@NonNull Element element)
      Method filters passed element children (and subchildren) and returns first child matching this path
      Parameters:
      element -
      Returns:
    • evaluateAll

      public @NonNull List<Element> evaluateAll(@NonNull Element element)
      Method filters passed element children (and subchildren) and returns children matching this path
      Parameters:
      element -
      Returns:
    • then

      public Path then(ElementMatcher matcher)
      Method for building a new path by adding additional element matcher to the end of the path
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object