com.bluecast.xml
Class JAXPSAXParserFactory

java.lang.Object
  |
  +--javax.xml.parsers.SAXParserFactory
        |
        +--com.bluecast.xml.JAXPSAXParserFactory

public class JAXPSAXParserFactory
extends SAXParserFactory

JAXP factory class for creating SAX parsers. This factory creates an instance of Piccolo when a non-validating parser is requested.

If a validating parser is requested, this class will search for another SAXParserFactory to create the validating parser. This class will search for a factory in the following ways:

  1. The system property com.bluecast.xml.ValidatingSAXParserFactory
  2. The next listed Service Provider for javax.xml.parsers.SAXParserFactory
  3. Crimson (org.apache.crimson.jaxp.SAXParserFactoryImpl)
If all of the above fail, a ParserConfigurationException will be thrown.

Version:
$Revision: 1.1 $
Author:
Yuval Oren, yuval@bluecast.com

Constructor Summary
JAXPSAXParserFactory()
           
 
Method Summary
 boolean getFeature(java.lang.String name)
          Retrieves a current factory feature flag setting.
 SAXParser newSAXParser()
          Returns a new instance of a SAXParser using the platform default implementation and the currently specified factory feature flag settings.
 void setFeature(java.lang.String name, boolean enabled)
          Establishes a factory parameter corresponding to the specified feature flag.
 void setNamespaceAware(boolean awareness)
           
 void setValidating(boolean value)
           
 
Methods inherited from class javax.xml.parsers.SAXParserFactory
isNamespaceAware, isValidating, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXPSAXParserFactory

public JAXPSAXParserFactory()
Method Detail

getFeature

public boolean getFeature(java.lang.String name)
                   throws ParserConfigurationException,
                          SAXNotRecognizedException,
                          SAXNotSupportedException
Description copied from class: SAXParserFactory
Retrieves a current factory feature flag setting.

Specified by:
getFeature in class SAXParserFactory
Parameters:
name - identifies the feature flag
Throws:
SAXNotSupportedException - if the specified SAX2 feature flag values can not be accessed before parsing begins.
SAXNotRecognizedException - if the specified SAX2 feature flag is not recognized
ParserConfigurationException

newSAXParser

public SAXParser newSAXParser()
                       throws ParserConfigurationException,
                              SAXException
Description copied from class: SAXParserFactory
Returns a new instance of a SAXParser using the platform default implementation and the currently specified factory feature flag settings.

Specified by:
newSAXParser in class SAXParserFactory
Throws:
ParserConfigurationException - when the parameter combination is not supported
SAXException

setFeature

public void setFeature(java.lang.String name,
                       boolean enabled)
                throws ParserConfigurationException,
                       SAXNotRecognizedException,
                       SAXNotSupportedException
Description copied from class: SAXParserFactory
Establishes a factory parameter corresponding to the specified feature flag.

Specified by:
setFeature in class SAXParserFactory
Parameters:
name - identifies the feature flag
enabled - specifies the desired flag value
Throws:
SAXNotSupportedException - if the specified SAX2 feature flag values can not be set, perhaps because of sequencing requirements (which could be met by using SAX2 directly)
SAXNotRecognizedException - if the specified SAX2 feature flag is not recognized
ParserConfigurationException

setNamespaceAware

public void setNamespaceAware(boolean awareness)
Overrides:
setNamespaceAware in class SAXParserFactory

setValidating

public void setValidating(boolean value)
Overrides:
setValidating in class SAXParserFactory