Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jdaemon.util.xml
Class DOMBuilder  view DOMBuilder download DOMBuilder.java

java.lang.Object
  extended byorg.jdaemon.util.xml.DOMBuilder

public class DOMBuilder
extends java.lang.Object

Utility class for building a DOM document


Nested Class Summary
private  class DOMBuilder.Namespace
          Private class representing namespace
 
Field Summary
private  java.lang.Object default_namespace
           
private  org.w3c.dom.Document doc
           
private  org.w3c.dom.Node top
           
 
Constructor Summary
DOMBuilder()
          Create a new DomBuilder containing an empty document
DOMBuilder(org.w3c.dom.Document doc)
          Creates a new instance of DOMBuilder.
 
Method Summary
 void addAttributes(org.jdaemon.util.AttributeList attrs)
          Add a set of attributes to the current tag
 java.lang.Object addNamespace(java.lang.String prefix, java.lang.String URI)
          Add a namespace to the document
 void addText(java.lang.String text)
          Add text to the current tag
 void begin(java.lang.Object namespace, java.lang.String tagName)
          Begin a tag.
 void begin(java.lang.String tagName)
          Begin a tag.
private static org.w3c.dom.Document createDocument()
          Create an empty document.
 void end()
          End a tag.
 org.w3c.dom.Document getDocument()
          Get the DOM document
private  java.lang.String getPrefix(java.lang.Object namespace)
          Get prefix from namespace
private  java.lang.String getURI(java.lang.Object namespace)
          Get URI from namespace
 void setDefaultNamespace(java.lang.Object namespace)
          Set the default namespace that will be used by begin(tagName)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doc

private org.w3c.dom.Document doc

top

private org.w3c.dom.Node top

default_namespace

private java.lang.Object default_namespace
Constructor Detail

DOMBuilder

public DOMBuilder(org.w3c.dom.Document doc)
Creates a new instance of DOMBuilder.


DOMBuilder

public DOMBuilder()
           throws InitialisationException
Create a new DomBuilder containing an empty document

Method Detail

addNamespace

public java.lang.Object addNamespace(java.lang.String prefix,
                                     java.lang.String URI)
Add a namespace to the document


getPrefix

private java.lang.String getPrefix(java.lang.Object namespace)
Get prefix from namespace


getURI

private java.lang.String getURI(java.lang.Object namespace)
Get URI from namespace


setDefaultNamespace

public void setDefaultNamespace(java.lang.Object namespace)
Set the default namespace that will be used by begin(tagName)


createDocument

private static org.w3c.dom.Document createDocument()
                                            throws InitialisationException
Create an empty document.


begin

public void begin(java.lang.Object namespace,
                  java.lang.String tagName)
Begin a tag. The new tag becomes the current tag.


begin

public void begin(java.lang.String tagName)
Begin a tag. Equivalent to begin(getNamespace(default_prefix, default_URI), tagName) where default_prefix and default_URI are whatever was passed to the constructor...


end

public void end()
End a tag. This tag's parent becomes the current tag.


addAttributes

public void addAttributes(org.jdaemon.util.AttributeList attrs)
Add a set of attributes to the current tag


addText

public void addText(java.lang.String text)
Add text to the current tag


getDocument

public org.w3c.dom.Document getDocument()
Get the DOM document