wt.projmgmt.msproject.mppobject
Class MPPExtendedAttributeBuilder

java.lang.Object
  extended bywt.projmgmt.msproject.DefaultSAXContentHandler
      extended bywt.projmgmt.msproject.ChildContentHandler
          extended bywt.projmgmt.msproject.mppobject.MPPExtendedAttributeBuilder
All Implemented Interfaces:
ContentHandler, ContentHandler

public class MPPExtendedAttributeBuilder
extends ChildContentHandler

A ContentHandler that parses the values for an ExtendedAttribute element.


Field Summary
private  StringBuffer buffer
           
private static int EA_MAP_INIT_CAPACITY
           
private  Map map
           
 
Fields inherited from class wt.projmgmt.msproject.ChildContentHandler
 
Constructor Summary
MPPExtendedAttributeBuilder(ContentHandler parent)
          Create a handler that parses values for an ExtendedAttribute element.
 
Method Summary
private  void addKeyValuePair(String namespaceURL, String localName, String qName)
          If there is character content in the content buffer, add it it to the map.
 void characters(char[] ch, int start, int length)
           
 void endElement(String namespaceURL, String localName, String qName)
           
 String getValue()
          Get the Value of this extended attribute.
 long getValueID()
          Get the ValueID of this extended attribute.
 boolean isDefined()
          Returns true if this handler contains a complete set of data to define an extended attribute.
private  void printKeyValuePairs()
          Print out the key=>value pairs that this handler has parsed so far.
 void reset()
          Removes all mappings from this handler.
 
Methods inherited from class wt.projmgmt.msproject.ChildContentHandler
getDocumentLocator, getImportInfo, getParent, getReader, setDocumentLocator, setParent
 
Methods inherited from class wt.projmgmt.msproject.DefaultSAXContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, outputEndElement, outputStartElement, processingInstruction, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startElement, startPrefixMapping
 

Field Detail

EA_MAP_INIT_CAPACITY

private static final int EA_MAP_INIT_CAPACITY
See Also:
Constant Field Values

map

private final Map map

buffer

private StringBuffer buffer
Constructor Detail

MPPExtendedAttributeBuilder

public MPPExtendedAttributeBuilder(ContentHandler parent)
Create a handler that parses values for an ExtendedAttribute element.

Parameters:
parent - the parent handler
Method Detail

getValueID

public long getValueID()
Get the ValueID of this extended attribute.


getValue

public String getValue()
Get the Value of this extended attribute.


isDefined

public boolean isDefined()
Returns true if this handler contains a complete set of data to define an extended attribute.


reset

public void reset()
Removes all mappings from this handler.


characters

public final void characters(char[] ch,
                             int start,
                             int length)
                      throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultSAXContentHandler
Throws:
SAXException

endElement

public final void endElement(String namespaceURL,
                             String localName,
                             String qName)
                      throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultSAXContentHandler
Throws:
SAXException

addKeyValuePair

private final void addKeyValuePair(String namespaceURL,
                                   String localName,
                                   String qName)
If there is character content in the content buffer, add it it to the map. Use the name of the current element as the key the value. Clear the content buffer before returning.

If there is no content or there is no element name on the stack, this method does not add any value to the object. It still clears the content buffer in these cases.


printKeyValuePairs

private final void printKeyValuePairs()
Print out the key=>value pairs that this handler has parsed so far.