|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.xmlc.parsers.DocBuilder
Class for building a Document DOM. Used by XMLC XML parsers to build a DOM as well as collect other information about the document.
The document builder functions assume they are being called in the order the document is parsed. They keep a current node where new child nodes are appended.
Field Summary | |
protected Node |
fCurrentNode
The current node that is being constructed. |
Constructor Summary | |
DocBuilder(XMLCDomFactory domFactory)
Constructor. |
Method Summary | |
void |
addAttribute(String namespaceURI,
String name,
String value)
Add an attribute to the element on the top of the stack. |
void |
addCDATASection(String data)
Add a CDATASection node. |
void |
addComment(String data)
Add a Comment node. |
void |
addEntityReference(String name)
Add an EntityReference object. |
void |
addIdAttribute(String elementName,
String attributeName)
Define an element id attribute. |
void |
addPCDataContentElement(String elementName)
Flag a element as having #PCDATA as part of its content model. |
void |
addProcessingInstruction(String target,
String data)
Add a ProcessingInstruction node. |
void |
addTextNode(String data)
Add a Text node. |
void |
endEntityReference()
End an entity reference. |
void |
finish()
Called at the end of parsing, to finish any pending tasks, default values, etc. |
void |
finishElement()
Finish the element being constructed. |
Node |
getCurrentNode()
Get the node on the top of the stack during parsing. |
XMLCDocument |
getDocument()
Get the document associated with this object. |
void |
popCurrentNode()
Pop the current node off of the stack. |
void |
setDocumentTypeName(String docTypeName)
Set the document type name (rootElement). |
void |
setEncoding(String encoding)
Set the encoding for the document. |
void |
setInternalSubset(String subsetStr)
Add internal subset as a single string. |
void |
setPublicId(String publicId)
Set the publicId. |
void |
setSystemId(String systemId)
Set the systemId. |
void |
setXMLVersion(String xmlVersion)
Set the XML version. |
void |
startElement(String namespaceURI,
String tagName)
Start a new Element. |
void |
startEntityReference(String entityName)
Start an entity reference in the document (not DTD). |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected Node fCurrentNode
Constructor Detail |
public DocBuilder(XMLCDomFactory domFactory) throws XMLCException
domFactory
- Factory class for Documents.Method Detail |
public void setXMLVersion(String xmlVersion)
xmlVersion
- XML version string.public void setEncoding(String encoding)
encoding
- The encoding for the document.public void setDocumentTypeName(String docTypeName)
docTypeName
- The Document type name (also root node name).public void setPublicId(String publicId)
publicId
- Document type public id or null if standalone.public void setSystemId(String systemId)
systemId
- Document type system id or null if standalone.public void setInternalSubset(String subsetStr)
public void addPCDataContentElement(String elementName)
public void addIdAttribute(String elementName, String attributeName)
public XMLCDocument getDocument()
public Node getCurrentNode()
public void popCurrentNode()
public void startElement(String namespaceURI, String tagName)
public void addAttribute(String namespaceURI, String name, String value)
public void finishElement()
public void startEntityReference(String entityName)
public void endEntityReference()
public void addTextNode(String data)
Text
node.public void addComment(String data)
Comment
node.public void addCDATASection(String data)
CDATASection
node.public void addProcessingInstruction(String target, String data)
ProcessingInstruction
node.public void addEntityReference(String name)
public void finish()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |