Class Attribute
- java.lang.Object
-
- net.sourceforge.pmd.lang.rule.xpath.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 Summary
Constructors Constructor Description Attribute(Node parent, String name, MethodHandle handle, Method m)
Creates a new attribute belonging to the given node using its accessor.Attribute(Node parent, String name, String value)
Creates a new attribute belonging to the given node using its string value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getName()
Node
getParent()
String
getStringValue()
Type
getType()
Gets the generic type of the value of this attribute.Object
getValue()
int
hashCode()
boolean
isDeprecated()
String
replacementIfDeprecated()
Returns null for "not deprecated", empty string for "deprecated without replacement", otherwise name of replacement attribute.String
toString()
-
-
-
Constructor Detail
-
Attribute
public Attribute(Node parent, String name, MethodHandle handle, Method m)
Creates a new attribute belonging to the given node using its accessor.
-
-
Method Detail
-
getType
public Type getType()
Gets the generic type of the value of this attribute.
-
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()
-
-