com.jaxfront.core.dom
Class DOMBuilder

java.lang.Object
  extended by com.jaxfront.core.dom.DOMBuilder

public class DOMBuilder
extends java.lang.Object

Used for creating JAXFront Documents (DOM). For creating a JAXFrontDOM only an XML Schema and the root name is a must. Optional is an according XML Instance and a eXtensible User Interface (XUI) document.


Field Summary
static java.lang.String USE_XUI
           
 
Method Summary
 void bindDefaultXUI(Document dom)
           
 Document build(java.lang.String context, org.w3c.dom.ls.LSInput xsdInput, org.w3c.dom.Document w3CDOM, org.w3c.dom.ls.LSInput xuiInput, java.lang.String rootName, java.util.Hashtable domArgs)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, org.w3c.dom.ls.LSInput xsdInput, org.w3c.dom.Document w3CDOM, org.w3c.dom.ls.LSInput xuiInput, java.lang.String rootName, java.util.Hashtable domArgs, org.apache.xerces.xni.parser.XMLEntityResolver resolver, boolean keepSchemaInMemory)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, org.w3c.dom.ls.LSInput xsdInput, org.w3c.dom.ls.LSInput xmlInput, org.w3c.dom.ls.LSInput xuiInput, java.lang.String rootName, java.util.Hashtable domArgs)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL)
          Builds a JAXFront Document based on a XML Schema.
 Document build(java.lang.String context, java.net.URL xsdURL, org.w3c.dom.Document xmlDOM, java.net.URL xuiURL, java.lang.String rootName)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL, org.w3c.dom.Document xmlDOM, java.net.URL xuiURL, java.lang.String rootName, java.util.Hashtable domArgs)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL, java.io.Reader xmlReader, java.net.URL xuiURL, java.lang.String rootName)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL, java.io.Reader xmlReader, java.net.URL xuiURL, java.lang.String rootName, java.util.Hashtable buildProps)
          Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL, java.lang.String rootName)
          Builds a JAXFront Document based on a XML Schema and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL, java.net.URL xmlURL, java.net.URL xuiURL, java.lang.String rootName)
          Builds a JAXFront Document based on a XML Schema,a XML Instance, a XUI definition and a root name.
 Document build(java.lang.String context, java.net.URL xsdURL, java.net.URL xmlURL, java.net.URL xuiURL, java.lang.String rootName, java.util.Hashtable domArgs)
          Builds a JAXFront Document based on a XML Schema,a XML Instance, a XUI definition and a root name.
 Document build(java.net.URL baseURL, java.lang.String xsdString, java.lang.String xmlString, java.lang.String xuiString, java.lang.String rootName, java.util.Hashtable domArgs)
          Builds a JAXFront Document based on a XML Schema Stream,a XML Instance Stream, a XUI definition Stream and a root name.
 Document buildImplicit(org.w3c.dom.Document xmlDOM, java.net.URL xmlURL, java.net.URL xuiURL)
           
 Document buildImplicit(java.lang.String xmlContent)
          Builds a JAXFront Document based on a XML string pointing to a XMLSchema thourgh the xsi:schemaLocation attribute.
 Document buildImplicit(java.lang.String context, java.net.URL xmlURL, java.lang.String rootName)
          Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute.
 Document buildImplicit(java.lang.String context, java.net.URL xmlURL, java.net.URL xuiURL, java.lang.String rootName)
          Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute and an XUI.
 Document buildImplicit(java.net.URL xmlURL)
          Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute.
 Document buildImplicit(java.net.URL xmlURL, java.net.URL xuiURL)
          Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute and an XUI.
static java.lang.String extractIncludeURL(java.lang.String include)
           
static java.lang.String extractIncludeXpath(java.lang.String include)
           
 java.net.URL getDefaultXUILocationURL(java.net.URL xsdURL)
           
 org.xml.sax.EntityResolver getEntityResolver()
           
 org.w3c.dom.Document getExpandedXUIDOM(java.lang.String context, org.w3c.dom.Document w3CDOM, FingerPrint fingerPrint, boolean mergeGlobalDefinition, boolean removeRedundant)
          Returns a full W3C DOM tree for a base XUI DOM including referred file includes in any XUI DOM.
static DOMBuilder getInstance()
          Implemented as singleton.
 XMLSchemaBuilder getSchemaBuilder()
          Returns a single instance of XMLSchemaBuilder to build XMLSchemas.
 Document getXUISchemaDOM(java.lang.String context)
          Returns the JAXFront Document representing a XUI DOM.
 java.net.URL getXuiXsdURL()
           
 void initializeXUI(java.lang.String context, Document dom, org.w3c.dom.Document w3CDOM, java.net.URL xuiURL, boolean mergeGlobalDefinition)
          Initializes a JAXFront DOM with a XUI DOM (W3C) and a baseUrl to look for xui included.
 void initializeXUI(java.lang.String context, Document dom, org.w3c.dom.ls.LSInput xuiInput, boolean mergeGlobalDefinition)
          Initializes a JAXFront DOM with a XUI DOM (W3C) and a baseUrl to look for xui included.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_XUI

public static final java.lang.String USE_XUI
See Also:
Constant Field Values
Method Detail

bindDefaultXUI

public void bindDefaultXUI(Document dom)

build

public Document build(java.lang.String context,
                      org.w3c.dom.ls.LSInput xsdInput,
                      org.w3c.dom.Document w3CDOM,
                      org.w3c.dom.ls.LSInput xuiInput,
                      java.lang.String rootName,
                      java.util.Hashtable domArgs)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlDOM - XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
domArgs - Dom specific arguments used on dom creation time (e.g. language)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      org.w3c.dom.ls.LSInput xsdInput,
                      org.w3c.dom.Document w3CDOM,
                      org.w3c.dom.ls.LSInput xuiInput,
                      java.lang.String rootName,
                      java.util.Hashtable domArgs,
                      org.apache.xerces.xni.parser.XMLEntityResolver resolver,
                      boolean keepSchemaInMemory)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlDOM - XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
domArgs - Dom specific arguments used on dom creation time (e.g. language)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      org.w3c.dom.ls.LSInput xsdInput,
                      org.w3c.dom.ls.LSInput xmlInput,
                      org.w3c.dom.ls.LSInput xuiInput,
                      java.lang.String rootName,
                      java.util.Hashtable domArgs)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlDOM - XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
domArgs - Dom specific arguments used on dom creation time (e.g. language)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema. The root name will be the first global element within the XML Schema.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      org.w3c.dom.Document xmlDOM,
                      java.net.URL xuiURL,
                      java.lang.String rootName)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlDOM - XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      org.w3c.dom.Document xmlDOM,
                      java.net.URL xuiURL,
                      java.lang.String rootName,
                      java.util.Hashtable domArgs)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlDOM - XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
domArgs - Dom specific arguments used on dom creation time (e.g. language)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      java.io.Reader xmlReader,
                      java.net.URL xuiURL,
                      java.lang.String rootName)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlReader - Reader for an XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      java.io.Reader xmlReader,
                      java.net.URL xuiURL,
                      java.lang.String rootName,
                      java.util.Hashtable buildProps)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance Document , a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlReader - Reader for an XML Instance Document
xuiURL - location of the XUI Definition
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      java.lang.String rootName)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      java.net.URL xmlURL,
                      java.net.URL xuiURL,
                      java.lang.String rootName)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance, a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlURL - location of the XML Instance
xuiURL - location of the XUI Definition
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.lang.String context,
                      java.net.URL xsdURL,
                      java.net.URL xmlURL,
                      java.net.URL xuiURL,
                      java.lang.String rootName,
                      java.util.Hashtable domArgs)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema,a XML Instance, a XUI definition and a root name.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xsdURL - location of the XML Schema
xmlURL - location of the XML Instance
xuiURL - location of the XUI Definition
rootName - name of the root element
domArgs - Dom specific arguments used on dom creation time (e.g. language)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

build

public Document build(java.net.URL baseURL,
                      java.lang.String xsdString,
                      java.lang.String xmlString,
                      java.lang.String xuiString,
                      java.lang.String rootName,
                      java.util.Hashtable domArgs)
               throws SchemaCreationException,
                      DocumentCreationException
Builds a JAXFront Document based on a XML Schema Stream,a XML Instance Stream, a XUI definition Stream and a root name.

Parameters:
baseURL - base url for look for nls & codeset files
xsdString - XML Schema Stream
xmlString - XML Instance Stream
xuiString - XUI Definition Stream
rootName - name of the root element
domArgs - Dom specific arguments used on dom creation time (e.g. language)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront DOM

buildImplicit

public Document buildImplicit(org.w3c.dom.Document xmlDOM,
                              java.net.URL xmlURL,
                              java.net.URL xuiURL)
                       throws SchemaCreationException,
                              DocumentCreationException
Throws:
SchemaCreationException
DocumentCreationException

buildImplicit

public Document buildImplicit(java.lang.String xmlContent)
                       throws SchemaCreationException,
                              DocumentCreationException
Builds a JAXFront Document based on a XML string pointing to a XMLSchema thourgh the xsi:schemaLocation attribute.

Parameters:
xmlContent - xml content as string containing xml schema location
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

buildImplicit

public Document buildImplicit(java.lang.String context,
                              java.net.URL xmlURL,
                              java.lang.String rootName)
                       throws SchemaCreationException,
                              DocumentCreationException
Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xmlURL - location of the XML (must have a schemaLocation)
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

buildImplicit

public Document buildImplicit(java.lang.String context,
                              java.net.URL xmlURL,
                              java.net.URL xuiURL,
                              java.lang.String rootName)
                       throws SchemaCreationException,
                              DocumentCreationException
Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute and an XUI.

Parameters:
context - needed for client-capable systems for the ability to identify the right properties (jaxfront.xml )
xmlURL - location of the XML (must have a schemaLocation)
xuiURL - location of the XUI
rootName - name of the root element
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

buildImplicit

public Document buildImplicit(java.net.URL xmlURL)
                       throws SchemaCreationException,
                              DocumentCreationException
Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute.

Parameters:
xmlURL - location of the XML (must have a schemaLocation)
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

buildImplicit

public Document buildImplicit(java.net.URL xmlURL,
                              java.net.URL xuiURL)
                       throws SchemaCreationException,
                              DocumentCreationException
Builds a JAXFront Document based on a XML pointing to a XMLSchema thourgh the xsi:schemaLocation attribute and an XUI.

Parameters:
xmlURL - location of the XML (must have a schemaLocation)
xuiURL - location of the XUI
Throws:
SchemaCreationException - if an exception occured during parsing the XML Schema
DocumentCreationException - if an exception occured during the building of a JAXFront document

extractIncludeURL

public static java.lang.String extractIncludeURL(java.lang.String include)

extractIncludeXpath

public static java.lang.String extractIncludeXpath(java.lang.String include)

getDefaultXUILocationURL

public java.net.URL getDefaultXUILocationURL(java.net.URL xsdURL)

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()

getExpandedXUIDOM

public org.w3c.dom.Document getExpandedXUIDOM(java.lang.String context,
                                              org.w3c.dom.Document w3CDOM,
                                              FingerPrint fingerPrint,
                                              boolean mergeGlobalDefinition,
                                              boolean removeRedundant)
                                       throws DocumentCreationException
Returns a full W3C DOM tree for a base XUI DOM including referred file includes in any XUI DOM.

Parameters:
w3CDOM - base XUI DOM
fingerPrint - base fingerprint to look for any xui includes
Throws:
DocumentCreationException - if the creation of any DOM failed

getInstance

public static DOMBuilder getInstance()
Implemented as singleton. Returns the only DOMBuilder instance.


getSchemaBuilder

public XMLSchemaBuilder getSchemaBuilder()
                                  throws SchemaCreationException
Returns a single instance of XMLSchemaBuilder to build XMLSchemas.

Throws:
SchemaCreationException

getXUISchemaDOM

public Document getXUISchemaDOM(java.lang.String context)
Returns the JAXFront Document representing a XUI DOM. This document was built on the xui.xsd and is initialized only ones (lazy) during the lifecycle of the VM.


getXuiXsdURL

public java.net.URL getXuiXsdURL()

initializeXUI

public void initializeXUI(java.lang.String context,
                          Document dom,
                          org.w3c.dom.Document w3CDOM,
                          java.net.URL xuiURL,
                          boolean mergeGlobalDefinition)
Initializes a JAXFront DOM with a XUI DOM (W3C) and a baseUrl to look for xui included.

Parameters:
xsdURL - XMLSchema URL
dom - JAXFront DOM to bind XUI information
w3CDOM - base XUI DOM
baseURL - base url to look for included XUI files

initializeXUI

public void initializeXUI(java.lang.String context,
                          Document dom,
                          org.w3c.dom.ls.LSInput xuiInput,
                          boolean mergeGlobalDefinition)
Initializes a JAXFront DOM with a XUI DOM (W3C) and a baseUrl to look for xui included.

Parameters:
xsdURL - XMLSchema URL
dom - JAXFront DOM to bind XUI information
w3CDOM - base XUI DOM
baseURL - base url to look for included XUI files