Class JAXPParserFactory

java.lang.Object
  extended by JAXPParserFactory
 class JAXPParserFactory
extends java.lang.Object

A non-public utility class to allocate JAXP SAX parsers.

Field Summary
private static java.lang.StringCVS_ID
           
private static java.lang.StringJAXP_SCHEMA_LANGUAGE_PROPERTY
          JAXP 1.2 schema language property id.
private static java.lang.StringJAXP_SCHEMA_LOCATION_PROPERTY
          JAXP 1.2 schema location property id.
 
Constructor Summary
private JAXPParserFactory()
          Private constructor to forbid allocating instances of this utility class.
 
Method Summary
static org.xml.sax.XMLReadercreateParser(boolean validating, java.util.Map features, java.util.Map properties)
          Creates a SAX parser allocated through the configured JAXP SAX parser factory.
private static voidsetProperty(javax.xml.parsers.SAXParser parser, java.util.Map properties, java.lang.String name)
          Sets a property on a JAXP SAX parser object if and only if it is declared in the user-defined properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_ID

private static final java.lang.String CVS_ID
See Also:
Constant Field Values

JAXP_SCHEMA_LANGUAGE_PROPERTY

private static final java.lang.String JAXP_SCHEMA_LANGUAGE_PROPERTY
JAXP 1.2 schema language property id.

See Also:
Constant Field Values

JAXP_SCHEMA_LOCATION_PROPERTY

private static final java.lang.String JAXP_SCHEMA_LOCATION_PROPERTY
JAXP 1.2 schema location property id.

See Also:
Constant Field Values
Constructor Detail

JAXPParserFactory

private JAXPParserFactory()
Private constructor to forbid allocating instances of this utility class.

Method Detail

createParser

public static org.xml.sax.XMLReader createParser(boolean validating,
                                                 java.util.Map features,
                                                 java.util.Map properties)
                                          throws JDOMException
Creates a SAX parser allocated through the configured JAXP SAX parser factory.

Parameters:
validating - whether a validating parser is requested.
features - the user-defined SAX features.
properties - the user-defined SAX properties.
Returns:
a configured XMLReader.
Throws:
JDOMException - if any error occurred when allocating or configuring the JAXP SAX parser.

setProperty

private static void setProperty(javax.xml.parsers.SAXParser parser,
                                java.util.Map properties,
                                java.lang.String name)
                         throws JDOMException
Sets a property on a JAXP SAX parser object if and only if it is declared in the user-defined properties.

Parameters:
parser - the JAXP SAX parser to configure.
properties - the user-defined SAX properties.
name - the name of the property to set.
Throws:
JDOMException - if any error occurred while configuring the property.