jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.domutil
Class DOMStub

java.lang.Object
  extended byuk.co.weft.domutil.DOMStub

public final class DOMStub
extends java.lang.Object

a stub to hang onto and return a DOM implementation and other global DOM stuff, including a DocumentBuilder. All methods are class methods - this class is not intended to be instantiated! Users should call init() before calling getDOMImplementation().

This class is aware of the following configuration parameters:

dom_coalescing
Boolean. Set parsers obtained from this stub to be coalescing. Optional. Default depends on chosen dom_implementation.
dom_expand_entity_references
Boolean. Set parsers obtained from this stub to expand entity references. Optional. Default depends on chosen dom_implementation.
dom_ignore_comments
Boolean. Set parsers obtained from this stub to ignore comments. Optional. Default depends on chosen dom_implementation.
dom_ignore_whitespace
Boolean. Set parsers obtained from this stub to ignore 'ignorable whitespace' if validating. Optional. Default depends on chosen dom_implementation.
dom_implementation_class
String: fully qualified name of a class accessible on the classpath which implements org.w3c.dom.DOMImplementation. Optional. Defaults to org.apache.xerces.dom.DOMImplementationImpl.
dom_namespace_aware
Boolean. Set parsers obtained from this stub to be namespace aware. Optional. Default depends on chosen dom_implementation.
dom_validating
Boolean. Set parsers obtained from this stub to be validating. Optional. Default depends on chosen dom_implementation.

Version:
$Revision: 1.8.4.4 $ This revision: $Author: simon $
Author:
Simon Brooke
See Also:
DOMImplementation, DocumentBuilderFactory.setCoalescing(boolean), DocumentBuilderFactory.setExpandEntityReferences(boolean), DocumentBuilderFactory.setIgnoringComments(boolean), DocumentBuilderFactory.setIgnoringElementContentWhitespace(boolean)., DocumentBuilderFactory.setNamespaceAware(boolean), DocumentBuilderFactory.setValidating(boolean)

Constructor Summary
DOMStub()
           
 
Method Summary
static DOMImplementation getDOMImplementation(Context context)
          get a handle on my dom implementation
static DocumentBuilder getParser()
          Why is a DocumentBuilder called a DocumentBuilder not a Parser, when what it does is parses? Search me.
static void init(Context config)
          Should be called before DOMStub is used, but perfectly safe to call more than once.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMStub

public DOMStub()
Method Detail

getDOMImplementation

public static DOMImplementation getDOMImplementation(Context context)
                                              throws GenerationException
get a handle on my dom implementation

Parameters:
context - the service context
Returns:
the dom implementation
Throws:
GenerationException - if I have not been initialised

getParser

public static DocumentBuilder getParser()
                                 throws GenerationException
Why is a DocumentBuilder called a DocumentBuilder not a Parser, when what it does is parses? Search me. Anyway, get one.

Throws:
GenerationException

init

public static void init(Context config)
                 throws InitialisationException
Should be called before DOMStub is used, but perfectly safe to call more than once. If I've already been initialised, don't intialise me again.

Parameters:
config - my configuration
Throws:
InitialisationException - if requested DOM implementation can't be found

jacquard 1.12.0 by The Web Engineering Factory and Toolworks