wt.projmgmt.msproject.mppobject
Class MPPPredecessorLinkBuilder

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

public class MPPPredecessorLinkBuilder
extends ChildContentHandler

A ContentHandler that parses the values for an ExtendedAttribute element.


Field Summary
private  StringBuffer buffer
           
private  Map map
           
private static int MAP_INIT_CAPACITY
           
 
Fields inherited from class wt.projmgmt.msproject.ChildContentHandler
 
Constructor Summary
MPPPredecessorLinkBuilder(ContentHandler parent)
          Create a handler that parses values for a PredecessorLink 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)
           
 long getPredecessorUID()
          Get the UID of the predecessor.
 int getType()
          Get the Type of the predecessor link.
 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

MAP_INIT_CAPACITY

private static final int MAP_INIT_CAPACITY
See Also:
Constant Field Values

map

private final Map map

buffer

private StringBuffer buffer
Constructor Detail

MPPPredecessorLinkBuilder

public MPPPredecessorLinkBuilder(ContentHandler parent)
Create a handler that parses values for a PredecessorLink element.

Parameters:
parent - the parent handler
Method Detail

getPredecessorUID

public long getPredecessorUID()
Get the UID of the predecessor.


getType

public int getType()
Get the Type of the predecessor link.


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.


printKeyValuePairs

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