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

Quick Search    Search Deep

org.merlotxml.util.xml.xml4j
Class DOMLiaison  view DOMLiaison download DOMLiaison.java

java.lang.Object
  extended byorg.merlotxml.util.xml.xml4j.DOMLiaison
All Implemented Interfaces:
org.merlotxml.util.xml.DOMLiaison, org.merlotxml.util.xml.ValidDOMLiaison

public class DOMLiaison
extends java.lang.Object
implements org.merlotxml.util.xml.ValidDOMLiaison


Nested Class Summary
 class DOMLiaison.DefaultErrorHandler
          Error handling class for the validating parser
 class DOMLiaison.MyEntityResolver
           
 
Field Summary
protected  java.util.List _entityResolverList
           
protected  java.util.Properties _properties
           
protected  XML4JLiaison4dom liaison
           
 
Constructor Summary
DOMLiaison()
           
 
Method Summary
 void addEntityResolver(org.xml.sax.EntityResolver er)
          extra entity resolvers to use to find a dtd.
 org.w3c.dom.Document createDocument()
          Create a Document
 org.merlotxml.util.xml.ValidDocument createValidDocument()
          Creates a new document that should maintain validity.
protected  void debug(java.lang.String s)
          simple debugging print routine
 org.merlotxml.util.xml.ValidDocument parseValidXMLStream(java.io.InputStream is, java.lang.String fileLocation)
          Parses an input stream containing XML using a validating parser.
 org.w3c.dom.Document parseXMLStream(java.io.InputStream s)
          Parse a stream of XML into a Document
 org.w3c.dom.Document parseXMLStream(java.io.Reader in)
           
 void print(org.w3c.dom.Document doc, java.io.Writer output, java.lang.String resultns, boolean format)
          Print a Document
 void print(org.merlotxml.util.xml.ValidDocument doc, java.io.Writer output, java.lang.String resultns, boolean format)
          Print that takes a valid document so it can print out the DTD specification properly.
private  void printImpl(org.w3c.dom.Document doc, java.io.Writer output, java.lang.String resultns, boolean format, java.lang.String externid)
           
protected  void printNamedNodeMap(org.w3c.dom.NamedNodeMap nnm)
          used for debugging
 void setProperties(java.util.Properties p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

liaison

protected XML4JLiaison4dom liaison

_properties

protected java.util.Properties _properties

_entityResolverList

protected java.util.List _entityResolverList
Constructor Detail

DOMLiaison

public DOMLiaison()
Method Detail

createDocument

public org.w3c.dom.Document createDocument()
Description copied from interface: org.merlotxml.util.xml.DOMLiaison
Create a Document

Specified by:
createDocument in interface org.merlotxml.util.xml.DOMLiaison

setProperties

public void setProperties(java.util.Properties p)
Specified by:
setProperties in interface org.merlotxml.util.xml.DOMLiaison

createValidDocument

public org.merlotxml.util.xml.ValidDocument createValidDocument()
Description copied from interface: org.merlotxml.util.xml.ValidDOMLiaison
Creates a new document that should maintain validity. NEW... not really used or implemented yet

Specified by:
createValidDocument in interface org.merlotxml.util.xml.ValidDOMLiaison

addEntityResolver

public void addEntityResolver(org.xml.sax.EntityResolver er)
extra entity resolvers to use to find a dtd. This allows the app to provide it's own. For example, if the app wants to present the user with a dialog to allow them to find the DTD.

Specified by:
addEntityResolver in interface org.merlotxml.util.xml.DOMLiaison

print

public void print(org.merlotxml.util.xml.ValidDocument doc,
                  java.io.Writer output,
                  java.lang.String resultns,
                  boolean format)
           throws org.merlotxml.util.xml.DOMLiaisonImplException
Description copied from interface: org.merlotxml.util.xml.ValidDOMLiaison
Print that takes a valid document so it can print out the DTD specification properly.

Specified by:
print in interface org.merlotxml.util.xml.ValidDOMLiaison

print

public void print(org.w3c.dom.Document doc,
                  java.io.Writer output,
                  java.lang.String resultns,
                  boolean format)
           throws org.merlotxml.util.xml.DOMLiaisonImplException
Description copied from interface: org.merlotxml.util.xml.DOMLiaison
Print a Document

Specified by:
print in interface org.merlotxml.util.xml.DOMLiaison

printImpl

private void printImpl(org.w3c.dom.Document doc,
                       java.io.Writer output,
                       java.lang.String resultns,
                       boolean format,
                       java.lang.String externid)
                throws org.merlotxml.util.xml.DOMLiaisonImplException

parseXMLStream

public org.w3c.dom.Document parseXMLStream(java.io.InputStream s)
                                    throws org.merlotxml.util.xml.DOMLiaisonImplException
Description copied from interface: org.merlotxml.util.xml.DOMLiaison
Parse a stream of XML into a Document

Specified by:
parseXMLStream in interface org.merlotxml.util.xml.DOMLiaison

parseXMLStream

public org.w3c.dom.Document parseXMLStream(java.io.Reader in)
                                    throws org.merlotxml.util.xml.DOMLiaisonImplException
Specified by:
parseXMLStream in interface org.merlotxml.util.xml.DOMLiaison

parseValidXMLStream

public org.merlotxml.util.xml.ValidDocument parseValidXMLStream(java.io.InputStream is,
                                                                java.lang.String fileLocation)
                                                         throws org.merlotxml.util.xml.DOMLiaisonImplException
Parses an input stream containing XML using a validating parser. Returns a ValidDocument which gives access to DTD information and stuff.

Specified by:
parseValidXMLStream in interface org.merlotxml.util.xml.ValidDOMLiaison

printNamedNodeMap

protected void printNamedNodeMap(org.w3c.dom.NamedNodeMap nnm)
used for debugging


debug

protected void debug(java.lang.String s)
simple debugging print routine