edu.umd.cs.findbugs.xml
Class XMLAttributeList

java.lang.Object
  extended by edu.umd.cs.findbugs.xml.XMLAttributeList

public class XMLAttributeList
extends java.lang.Object

Helper class to format attributes in an XML tag.

Author:
David Hovemeyer

Nested Class Summary
static class XMLAttributeList.NameValuePair
           
private static class XMLAttributeList.StringBufferQuoteMetaCharacters
           
 
Field Summary
private static MetaCharacterMap attrMetaCharacterMap
           
private  java.util.List<XMLAttributeList.NameValuePair> nameValuePairList
           
 
Constructor Summary
XMLAttributeList()
          Constructor.
 
Method Summary
 XMLAttributeList addAttribute(java.lang.String name, java.lang.String value)
          Add a single attribute name and value.
static java.lang.String getQuotedAttributeValue(java.lang.String rawValue)
          Return a properly quoted form for an attribute value.
 java.util.Iterator<XMLAttributeList.NameValuePair> iterator()
          Return an Iterator over NameValuePairs.
 java.lang.String toString()
          Return the attribute list as a String which can be directly output as part of an XML tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attrMetaCharacterMap

private static final MetaCharacterMap attrMetaCharacterMap

nameValuePairList

private java.util.List<XMLAttributeList.NameValuePair> nameValuePairList
Constructor Detail

XMLAttributeList

public XMLAttributeList()
Constructor. Creates an empty object.

Method Detail

addAttribute

public XMLAttributeList addAttribute(java.lang.String name,
                                     java.lang.String value)
Add a single attribute name and value.

Parameters:
name - the attribute name
value - the attribute value
Returns:
this object (so calls to addAttribute() can be chained)

toString

public java.lang.String toString()
Return the attribute list as a String which can be directly output as part of an XML tag.

Overrides:
toString in class java.lang.Object

iterator

public java.util.Iterator<XMLAttributeList.NameValuePair> iterator()
Return an Iterator over NameValuePairs.


getQuotedAttributeValue

public static java.lang.String getQuotedAttributeValue(java.lang.String rawValue)
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