Class SPath


  • public final class SPath
    extends Object
    Simple path.

    It must have the form: (part/)*part or (part(/part)*)?@part

    Author:
    Damien Carbonne
    • Constructor Detail

      • SPath

        public SPath​(String text)
    • Method Detail

      • isAttribute

        public boolean isAttribute()
      • isElement

        public boolean isElement()
      • matchesElement

        public boolean matchesElement​(Parent parent)
      • matchesElement

        public boolean matchesElement​(Parent parent,
                                      String name)
        Returns true if this SPath matches an element.
        Parameters:
        parent - The parent element.
        name - The name of the child element.
        Returns:
        true if this SPath matches child under parent.
      • matchesAttribute

        public boolean matchesAttribute​(Element parent,
                                        String name)
        Returns true if this SPath matches an attribute in an element.
        Parameters:
        parent - The element.
        name - The attribute name.
        Returns:
        true if this SPath matches an attribute named name in parent.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object