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

      • getType

        public Type getType()
        Gets the generic type of the value of this attribute.
      • getErasedType

        public Class<?> getErasedType()
      • getName

        public String getName()
      • getParent

        public Node getParent()
      • replacementIfDeprecated

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

        public boolean isDeprecated()
      • getValue

        public Object getValue()
      • getStringValue

        public String getStringValue()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object