Class Attribute


  • public class Attribute
    extends Object
    Represents an XPath attribute of a specific node. Attributes know their name, the node they wrap, and have access to their value.

    Two attributes are equal if they have the same name and their parent nodes are equal.

    Author:
    daniels
    • Constructor Detail

      • Attribute

        public Attribute​(Node parent,
                         String name,
                         Method m)
        Creates a new attribute belonging to the given node using its accessor.
      • Attribute

        public Attribute​(Node parent,
                         String name,
                         String value)
        Creates a new attribute belonging to the given node using its string value.
    • Method Detail

      • getName

        public String getName()
      • getParent

        public Node getParent()
      • getType

        @Experimental
        public Class<?> getType()
        Returns the most general type that the value may be.
      • replacementIfDeprecated

        @InternalApi
        public String replacementIfDeprecated()
        Returns null for "not deprecated", empty string for "deprecated without replacement", otherwise name of replacement attribute.
      • getValue

        public Object getValue()
      • getStringValue

        public String getStringValue()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object