Package edu.umd.cs.findbugs.xml
Class XMLAttributeList
java.lang.Object
edu.umd.cs.findbugs.xml.XMLAttributeList
Helper class to format attributes in an XML tag.
- Author:
- David Hovemeyer
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute
(String name, String value) Add a single attribute name and value.addOptionalAttribute
(String name, String value) Add a single attribute name and value.static String
getQuotedAttributeValue
(String rawValue) Return a properly quoted form for an attribute value.iterator()
Return an Iterator over NameValuePairs.toString()
Return the attribute list as a String which can be directly output as part of an XML tag.
-
Constructor Details
-
XMLAttributeList
public XMLAttributeList()Constructor. Creates an empty object.
-
-
Method Details
-
addAttribute
Add a single attribute name and value.- Parameters:
name
- the attribute namevalue
- the attribute value- Returns:
- this object (so calls to addAttribute() can be chained)
-
addOptionalAttribute
Add a single attribute name and value.- Parameters:
name
- the attribute namevalue
- the attribute value- Returns:
- this object (so calls to addAttribute() can be chained)
-
toString
Return the attribute list as a String which can be directly output as part of an XML tag. -
iterator
Return an Iterator over NameValuePairs. -
getQuotedAttributeValue
Return a properly quoted form for an attribute value.- Parameters:
rawValue
- the raw value of the attribute- Returns:
- a properly quoted representation of the value
-