wt.projmgmt.msproject.mppobject
Class MPPTaskBuilder

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

public class MPPTaskBuilder
extends MPPObjectBuilder

A ContentHandler that builds a MPPTask from the data contained in a section of the document it is parsing.


Field Summary
private  MPPPredecessorLinkBuilder plBuilder
           
 
Fields inherited from class wt.projmgmt.msproject.mppobject.MPPObjectBuilder
 
Fields inherited from class wt.projmgmt.msproject.ChildContentHandler
 
Constructor Summary
MPPTaskBuilder(ContentHandler parent)
          Create a handler that builds a MPPTask from a particular portion of the document being scanned.
MPPTaskBuilder(ContentHandler parent, String localName)
          Create a handler that builds a MPPTask from a particular portion of the document being scanned.
 
Method Summary
private  void addPredecessor(long uid, int type)
          Add the predecessor to the task using the correct ProjectLinkType.
protected  MPPObject createObject()
          Create the MPPObject that should be populated by this builder.
 void endElement(String namespaceURL, String localName, String qName)
           
 MPPTask getTask()
           
protected  boolean isUnsupported(String namespaceURL, String localName, String qName)
          Returns true if the specified element contains data that should be ignored by this builder.
 void reset()
          Reset the builder so that it can be used again.
 void startElement(String namespaceURL, String localName, String qName, Attributes atts)
           
 
Methods inherited from class wt.projmgmt.msproject.mppobject.MPPObjectBuilder
characters, getObject, isObjectValid, isScopeEnd, setScope
 
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, 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, startPrefixMapping
 

Field Detail

plBuilder

private final MPPPredecessorLinkBuilder plBuilder
Constructor Detail

MPPTaskBuilder

public MPPTaskBuilder(ContentHandler parent)
Create a handler that builds a MPPTask from a particular portion of the document being scanned.

If this constructor is used then MPPObjectBuilder.setScope(java.lang.String) must be called to set the scope before the builder is used.

Parameters:
parent - the parent handler

MPPTaskBuilder

public MPPTaskBuilder(ContentHandler parent,
                      String localName)
Create a handler that builds a MPPTask from a particular portion of the document being scanned.

When the end tag for the specified scope element is encontered, control is passed back to the parent handler.

Parameters:
parent - the parent handler
localName - the localName of the scoping element
Method Detail

reset

public void reset()
Description copied from class: MPPObjectBuilder
Reset the builder so that it can be used again. This causes a fresh object to be created, the content buffer to be cleared and the extended attribute builder to be reset.

Overrides:
reset in class MPPObjectBuilder

createObject

protected MPPObject createObject()
Description copied from class: MPPObjectBuilder
Create the MPPObject that should be populated by this builder.

Specified by:
createObject in class MPPObjectBuilder

getTask

public final MPPTask getTask()

isUnsupported

protected boolean isUnsupported(String namespaceURL,
                                String localName,
                                String qName)
Description copied from class: MPPObjectBuilder
Returns true if the specified element contains data that should be ignored by this builder. If this returns true for a particular element, then control will be turned over to a IgnoreContentHandler until the element is complete.

Specified by:
isUnsupported in class MPPObjectBuilder

startElement

public void startElement(String namespaceURL,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class MPPObjectBuilder
Throws:
SAXException

endElement

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

addPredecessor

private final void addPredecessor(long uid,
                                  int type)
Add the predecessor to the task using the correct ProjectLinkType. If there is no ProjectLinkType that corresponds to the type then the predecessor is not added.