Package ghidra.util.xml
Class XmlParserElement
java.lang.Object
ghidra.util.xml.XmlParserElement
A class to represent the start or end tag from an XML file.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
String[]
Returns an array containing the names of all attributes defined in this element.getAttrValue
(String attrName) Returns the value of the specified attribute.boolean
getAttrValueAsBool
(String attrName) Returns the boolean value of the specified attribute.double
getAttrValueAsDouble
(String attrName) Returns the double value of the specified attribute.int
getAttrValueAsInt
(String attrName) Returns the integer value of the specified attribute.long
getAttrValueAsLong
(String attrName) Returns the long value of the specified attribute.int
Returns the line number where this element was defined.getName()
Returns the name of this element/tag.getText()
Returns the text of this element.boolean
Returns true if this element contains an attribute with the specified name.boolean
isEnd()
Returns true if this element represents an end tag.boolean
isStart()
Returns true if this element represents a start tag.void
setAttribute
(String name, String value) Sets the value of the specified attribute.toString()
-
Method Details
-
equals
-
toString
-
isStart
public boolean isStart()Returns true if this element represents a start tag.- Returns:
- true if this element represents a start tag
-
isEnd
public boolean isEnd()Returns true if this element represents an end tag.- Returns:
- true if this element represents an end tag
-
getName
Returns the name of this element/tag.- Returns:
- the name of this element/tag
-
getLineNum
public int getLineNum()Returns the line number where this element was defined.- Returns:
- the line number where this element was defined
-
getText
Returns the text of this element. Or, null if no text existed in the XML.- Returns:
- the text of this element
-
getAttrValue
Returns the value of the specified attribute. Or, null if no attribute exists with the specified name.- Parameters:
attrName
- the name of the attribute- Returns:
- the value of the specified attribute
-
getAttrValueAsBool
Returns the boolean value of the specified attribute.- Parameters:
attrName
- the name of the attribute- Returns:
- the boolean value of the specified attribute
- Throws:
XmlAttributeException
- if no attribute exists with the specified name
-
getAttrValueAsInt
Returns the integer value of the specified attribute.- Parameters:
attrName
- the name of the attribute- Returns:
- the integer value of the specified attribute
- Throws:
XmlAttributeException
- if no attribute exists with the specified name
-
getAttrValueAsLong
Returns the long value of the specified attribute.- Parameters:
attrName
- the name of the attribute- Returns:
- the long value of the specified attribute
- Throws:
XmlAttributeException
- if no attribute exists with the specified name
-
getAttrValueAsDouble
Returns the double value of the specified attribute.- Parameters:
attrName
- the name of the attribute- Returns:
- the double value of the specified attribute
- Throws:
XmlAttributeException
- if no attribute exists with the specified name
-
getAttrNames
Returns an array containing the names of all attributes defined in this element.- Returns:
- an array containing the names of all attributes defined in this element
-
hasAttr
Returns true if this element contains an attribute with the specified name.- Parameters:
attrName
- the name of the attribute- Returns:
- true if this element contains an attribute with the specified name
-
setAttribute
Sets the value of the specified attribute.- Parameters:
name
- the name of the attributevalue
- the value of the attribute
-