|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.objectpools.PooledParserAccessHelper
public class PooledParserAccessHelper
This class encapsulates parsing using the standard SAX and DOM pooled parser configurations in the framework. Pooled SAX parsers are managed by SAXKeyedPoolFactory and pooled DOM parsers are managed by DOMPoolFactory.
The standard SAX and DOM pooled parser configurations in the framework are: 1. The pooled DOM parser configuration, which should be in the /config directory as pooled-dom-parser-config.xml. 2. The key pooled SAX Parser, which should be in the /config directory as keyed-pooled-sax-parser-config.xml.
| Field Summary | |
|---|---|
protected static boolean |
debugFlag
debugFlag. |
protected static java.lang.String |
thisClassName
The full name of this class. |
| Constructor Summary | |
|---|---|
PooledParserAccessHelper()
|
|
| Method Summary | |
|---|---|
static javax.xml.parsers.DocumentBuilder |
getDOMParser()
Borrow a DOM DocumentBuilder from the configured pool with the error handler set to DefaultErrorHandler. |
static void |
main(java.lang.String[] args)
Main method for testing and sandboxing. |
static org.w3c.dom.Document |
parseDOM(java.lang.String xmlText)
Parse XML payload using the standard pooled DOM parser. |
static void |
parseSAX(java.lang.String xmlText,
org.xml.sax.helpers.DefaultHandler saxHandler)
Parse XML payload using the standard keyed pooled SAX parser with key = 'namespaceaware-true', which is a non-validating parser. |
static void |
parseSAX(java.lang.String xmlText,
org.xml.sax.helpers.DefaultHandler saxHandler,
boolean namespaceaware,
boolean validating)
Parse XML payload using the standard keyed pooled SAX parser, specifying the namespaceAware and validating attributes for the parser. |
static void |
parseSAX(java.lang.String xmlText,
org.xml.sax.helpers.DefaultHandler saxHandler,
boolean namespaceaware,
boolean validating,
java.io.File[] schemaSource)
Parse XML payload using the standard keyed pooled SAX parser, specifying the namespaceAware and validating attributes for the parser. |
static void |
returnDOMParser(javax.xml.parsers.DocumentBuilder db)
Return a DOM DocumentBuilder to the configured pool. |
static void |
setDebugFlag(boolean theDebugFlag)
Sets the debugFlag for this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.lang.String thisClassName
protected static boolean debugFlag
| Constructor Detail |
|---|
public PooledParserAccessHelper()
| Method Detail |
|---|
public static org.w3c.dom.Document parseDOM(java.lang.String xmlText)
throws org.xml.sax.SAXException,
java.lang.Exception
xmlText - The XML document to parse.
org.xml.sax.SAXException - if there is an error parsing the document (i.e the xml is invalid)
java.lang.Exception - if there was an internal error parsing the XML
public static javax.xml.parsers.DocumentBuilder getDOMParser()
throws java.lang.Exception
java.lang.Exception - if there is an error getting a pooled DOM parser.
public static void returnDOMParser(javax.xml.parsers.DocumentBuilder db)
throws java.lang.Exception
java.lang.Exception - if there is an error returning the DocumentBuilder to the pool.
public static void parseSAX(java.lang.String xmlText,
org.xml.sax.helpers.DefaultHandler saxHandler)
throws org.xml.sax.SAXException,
java.lang.Exception
xmlText - The XML document to parse.saxHandler - A DefaultHandler object.
org.xml.sax.SAXException - if there is an error parsing the document (i.e the xml is invalid)
java.lang.Exception - if there was an internal error parsing the XML
public static void parseSAX(java.lang.String xmlText,
org.xml.sax.helpers.DefaultHandler saxHandler,
boolean namespaceaware,
boolean validating)
throws org.xml.sax.SAXException,
java.lang.Exception
xmlText - The XML document to parse.saxHandler - A DefaultHandler object.namespaceaware - Parser is namespaceaware, true/falsevalidating - Parser is validating, true/false
org.xml.sax.SAXException - if there is an error parsing the document (i.e the xml is invalid)
java.lang.Exception - if there was an internal error parsing the XML
public static void parseSAX(java.lang.String xmlText,
org.xml.sax.helpers.DefaultHandler saxHandler,
boolean namespaceaware,
boolean validating,
java.io.File[] schemaSource)
throws org.xml.sax.SAXException,
java.lang.Exception
xmlText - The XML document to parse.saxHandler - A DefaultHandler object.namespaceaware - Parser is namespaceaware, true/falsevalidating - Parser is validating, true/falseschemaSource - a File[] of schema sources
org.xml.sax.SAXException - if there is an error parsing the document (i.e the xml is invalid)
java.lang.Exception - if there was an internal error parsing the XMLpublic static void setDebugFlag(boolean theDebugFlag)
theDebugFlag - The debugFlag for this object.public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||