xmlBlaster 2.2.0 API

org.xmlBlaster.util
Class XmlToDom

java.lang.Object
  extended by org.xmlBlaster.util.XmlToDom

public class XmlToDom
extends java.lang.Object

Helper which parses a XML ASCII string into a DOM tree.


Field Summary
protected  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
protected  org.w3c.dom.Node rootNode
           
protected  java.lang.String xmlKey_literal
           
 
Constructor Summary
XmlToDom(Global glob, java.lang.String xmlKey_literal)
          Parses given xml string
 
Method Summary
 void create(java.lang.String xmlKey_literal)
          Creates the DOM tree, this is done delayed when the first access is done.
 java.lang.String domToXml(java.lang.String offset)
          Dump DOM tree to XML ASCII String.
 org.w3c.dom.NamedNodeMap getRootAttributes()
          The syntax of the XmlKey_literal String.
 org.w3c.dom.Node getRootNode()
          Fills the DOM tree, and assures that a valid is used.
 java.lang.String literal()
          Access the unparsed, literal ASCII xmlKey.
private  void loadDomTree()
          Fills the DOM tree, and assures that a valid is used.
 void mergeRootNode(I_MergeDomNode merger)
          Should be called by publish() to merge the local XmlKey DOM into the big xmlBlaster DOM tree
static org.w3c.dom.Document parseToDomTree(Global glob, java.lang.String xmlKey_literal)
           
 java.lang.StringBuffer printOn()
          Dump state of this object into XML.
 java.lang.StringBuffer printOn(java.lang.String extraOffset)
          Dump state of this object into XML.
 java.lang.String toString()
          Access the unparsed, literal ASCII xmlKey.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

protected Global glob

log

private static java.util.logging.Logger log

xmlKey_literal

protected java.lang.String xmlKey_literal

rootNode

protected org.w3c.dom.Node rootNode
Constructor Detail

XmlToDom

public XmlToDom(Global glob,
                java.lang.String xmlKey_literal)
         throws XmlBlasterException
Parses given xml string

Parameters:
The - original key in XML syntax, for example:
Throws:
XmlBlasterException
Method Detail

create

public final void create(java.lang.String xmlKey_literal)
                  throws XmlBlasterException
Creates the DOM tree, this is done delayed when the first access is done.

Parameters:
xmlKey_literal - The ASCII XML string
Throws:
XmlBlasterException

toString

public final java.lang.String toString()
Access the unparsed, literal ASCII xmlKey.

Overrides:
toString in class java.lang.Object
Returns:
the literal ASCII xmlKey

literal

public final java.lang.String literal()
Access the unparsed, literal ASCII xmlKey.

Returns:
the literal ASCII xmlKey

getRootAttributes

public final org.w3c.dom.NamedNodeMap getRootAttributes()
                                                 throws XmlBlasterException
The syntax of the XmlKey_literal String.

Throws:
XmlBlasterException

getRootNode

public final org.w3c.dom.Node getRootNode()
                                   throws XmlBlasterException
Fills the DOM tree, and assures that a valid is used.

Throws:
XmlBlasterException

loadDomTree

private void loadDomTree()
                  throws XmlBlasterException
Fills the DOM tree, and assures that a valid is used.

The keyOid will be set properly if no error occurs The rootNode will be set properly if no error occurs

Throws:
XmlBlasterException

parseToDomTree

public static org.w3c.dom.Document parseToDomTree(Global glob,
                                                  java.lang.String xmlKey_literal)
                                           throws XmlBlasterException
Throws:
XmlBlasterException

mergeRootNode

public final void mergeRootNode(I_MergeDomNode merger)
                         throws XmlBlasterException
Should be called by publish() to merge the local XmlKey DOM into the big xmlBlaster DOM tree

Throws:
XmlBlasterException

domToXml

public java.lang.String domToXml(java.lang.String offset)
Dump DOM tree to XML ASCII String.

A header like "" is removed

Parameters:
offset - indenting of tags with given blanks e.g. " "
Returns:
string with key meta data in XML syntax

printOn

public final java.lang.StringBuffer printOn()
                                     throws XmlBlasterException
Dump state of this object into XML.

Returns:
XML string
Throws:
XmlBlasterException

printOn

public final java.lang.StringBuffer printOn(java.lang.String extraOffset)
                                     throws XmlBlasterException
Dump state of this object into XML.

Parameters:
extraOffset - indenting of tags
Returns:
XML string
Throws:
XmlBlasterException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.