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.

Version:
1.60

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.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.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.w3c.dom.Document getExpandedXUIDOM(org.w3c.dom.Document w3CDOM, FingerPrint fingerPrint, boolean mergeGlobalDefinition)
          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()
          Returns the JAXFront Document representing a XUI DOM.
 java.net.URL getXuiXsdURL()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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,
                      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

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

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.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,
                      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.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

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

bindDefaultXUI

public void bindDefaultXUI(Document dom)

getXuiXsdURL

public java.net.URL getXuiXsdURL()

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

extractIncludeXpath

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

extractIncludeURL

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

getExpandedXUIDOM

public org.w3c.dom.Document getExpandedXUIDOM(org.w3c.dom.Document w3CDOM,
                                              FingerPrint fingerPrint,
                                              boolean mergeGlobalDefinition)
                                       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

getXUISchemaDOM

public Document getXUISchemaDOM()
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.


getDefaultXUILocationURL

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

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.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.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

buildImplicit

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