com.bluecast.xml
Class JAXPSAXParserFactory

java.lang.Object
  extended by javax.xml.parsers.SAXParserFactory
      extended by 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.7 $
Author:
Yuval Oren, yuval@bluecast.com

Constructor Summary
JAXPSAXParserFactory()
           
 
Method Summary
 boolean getFeature(java.lang.String name)
          Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.
static SAXParserFactory newInstance()
           
 SAXParser newSAXParser()
          Creates a new instance of a SAXParser using the currently configured factory parameters.
 void setFeature(java.lang.String name, boolean enabled)
          Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.
 void setNamespaceAware(boolean awareness)
          Specifies that the parser produced by this code will provide support for XML namespaces.
 void setValidating(boolean value)
          Specifies that the parser produced by this code will validate documents as they are parsed.
 
Methods inherited from class javax.xml.parsers.SAXParserFactory
isNamespaceAware, isValidating
 
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

newInstance

public static SAXParserFactory newInstance()

getFeature

public boolean getFeature(java.lang.String name)
                   throws ParserConfigurationException,
                          SAXNotRecognizedException,
                          SAXNotSupportedException
Description copied from class: SAXParserFactory
Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.

Specified by:
getFeature in class SAXParserFactory
Parameters:
name - The name of the property to be retrieved.
Returns:
Value of the requested property.
Throws:
SAXNotRecognizedException - When the underlying XMLReader does not recognize the property name.
SAXNotSupportedException - When the underlying XMLReader recognizes the property name but doesn't support the property.
ParserConfigurationException
See Also:
XMLReader.getProperty(java.lang.String)

newSAXParser

public SAXParser newSAXParser()
                       throws ParserConfigurationException,
                              SAXException
Description copied from class: SAXParserFactory
Creates a new instance of a SAXParser using the currently configured factory parameters.

Specified by:
newSAXParser in class SAXParserFactory
Returns:
A new instance of a SAXParser.
Throws:
ParserConfigurationException - if a parser cannot be created which satisfies the requested configuration.
SAXException

setFeature

public void setFeature(java.lang.String name,
                       boolean enabled)
                throws ParserConfigurationException,
                       SAXNotRecognizedException,
                       SAXNotSupportedException
Description copied from class: SAXParserFactory
Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader. A list of the core features and properties can be found at http://www.megginson.com/SAX/Java/features.html

Specified by:
setFeature in class SAXParserFactory
Parameters:
name - The name of the feature to be set.
enabled - The value of the feature to be set.
Throws:
SAXNotRecognizedException - When the underlying XMLReader does not recognize the property name.
SAXNotSupportedException - When the underlying XMLReader recognizes the property name but doesn't support the property.
ParserConfigurationException
See Also:
XMLReader.setFeature(java.lang.String, boolean)

setNamespaceAware

public void setNamespaceAware(boolean awareness)
Description copied from class: SAXParserFactory
Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set to false.

Overrides:
setNamespaceAware in class SAXParserFactory
Parameters:
awareness - true if the parser produced by this code will provide support for XML namespaces; false otherwise.

setValidating

public void setValidating(boolean value)
Description copied from class: SAXParserFactory
Specifies that the parser produced by this code will validate documents as they are parsed. By default the value of this is set to false.

Overrides:
setValidating in class SAXParserFactory
Parameters:
value - true if the parser produced by this code will validate documents as they are parsed; false otherwise.