|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.msproject.DefaultSAXContentHandler
wt.projmgmt.msproject.ChildContentHandler
wt.projmgmt.msproject.mppobject.MPPObjectBuilder
A ContentHandler
that builds a
MPPObject
from the data
contained in a section of the document it is parsing.
Field Summary | |
private StringBuffer |
buffer
|
private MPPExtendedAttributeBuilder |
eaBuilder
|
private IgnoreContentHandler |
ignoreHandler
|
private MPPObject |
mppObject
|
private String |
scope
|
Fields inherited from class wt.projmgmt.msproject.ChildContentHandler |
|
Constructor Summary | |
MPPObjectBuilder(ContentHandler parent)
Create a handler that builds a MPPObject
from a particular portion of the document being scanned. |
|
MPPObjectBuilder(ContentHandler parent,
String localName)
Create a handler that builds a MPPObject
from a particular portion of the document being scanned. |
Method Summary | |
private void |
addEA(long value_id,
String val)
Add the extended attribute to the object using the correct key . |
private void |
addKeyValuePair(String localName)
If there is character content in the content buffer, add it it to the object. |
void |
characters(char[] ch,
int start,
int length)
|
protected abstract MPPObject |
createObject()
Create the MPPObject
that should be populated by this builder. |
void |
endElement(String namespaceURL,
String localName,
String qName)
|
private void |
endScope()
The end of this builder's scope has been reached. |
MPPObject |
getObject()
Get the MPPObject that
this builder is building or has built. |
protected boolean |
isObjectValid(MPPObject mppObj)
Return true if the constructed object is valid. |
protected boolean |
isScopeEnd(String namespaceURL,
String localName,
String qName)
Returns true when the specified element indicates the end of this handler's scope |
protected abstract boolean |
isUnsupported(String namespaceURL,
String localName,
String qName)
Returns true if the specified element contains data that should be ignored by this builder. |
private void |
printKeyValuePairs()
Print out the key=>value pairs that this handler has parsed so far. |
void |
reset()
Reset the builder so that it can be used again. |
void |
setScope(String localName)
Set the scope of this builder. |
void |
startElement(String namespaceURL,
String localName,
String qName,
Attributes atts)
|
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 |
private MPPObject mppObject
private StringBuffer buffer
private final MPPExtendedAttributeBuilder eaBuilder
private final IgnoreContentHandler ignoreHandler
private String scope
Constructor Detail |
public MPPObjectBuilder(ContentHandler parent)
MPPObject
from a particular portion of the document being scanned.
If this constructor is used then setScope(java.lang.String)
must
be called to set the scope before the builder is used.
parent
- the parent handlerpublic MPPObjectBuilder(ContentHandler parent, String localName)
MPPObject
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.
parent
- the parent handlerlocalName
- the localName of the scoping elementMethod Detail |
public void reset()
public final MPPObject getObject()
MPPObject
that
this builder is building or has built.
isObjectValid(wt.projmgmt.msproject.mppobject.MPPObject)
protected abstract MPPObject createObject()
MPPObject
that should be populated by this builder.
protected boolean isObjectValid(MPPObject mppObj)
true
if the constructed object is valid.
By default, this method returns true
.
This method is used by getObject()
. If this method
return false
then getObject
returns null
, otherwise it returns the built
object.
protected abstract boolean isUnsupported(String namespaceURL, String localName, String qName)
IgnoreContentHandler
until the element is complete.
public void startElement(String namespaceURL, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultSAXContentHandler
SAXException
public final void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultSAXContentHandler
SAXException
public void endElement(String namespaceURL, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultSAXContentHandler
SAXException
protected boolean isScopeEnd(String namespaceURL, String localName, String qName)
private final void endScope() throws SAXException
SAXException
public void setScope(String localName)
private final void addKeyValuePair(String localName)
If there is no content this method does not add any value to the object. It still clears the content buffer in these cases.
private final void addEA(long value_id, String val)
key
.
private final void printKeyValuePairs()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |