net.sf.jasperreports.engine.xml
Class JRReportSaxParserFactory

java.lang.Object
  extended by net.sf.jasperreports.engine.xml.JRReportSaxParserFactory
All Implemented Interfaces:
JRSaxParserFactory

public class JRReportSaxParserFactory
extends java.lang.Object
implements JRSaxParserFactory

The default report SAX parser factory.

This factory creates a parser via the default SAX parser factory (javax.xml.parsers.SAXParserFactory.newInstance()).

JRXMLs are always validated using W3C XML schemas. Reports that refer the JasperReports DTD (which has been deprecated) are validated using an internal XML schema equivalent to the DTD.

To improve performance, XML schemas can be cached when using a Xerces SAX parser. See PROPERTY_CACHE_SCHEMAS.

Version:
$Id: JRReportSaxParserFactory.java 3657 2010-03-31 09:34:49Z teodord $
Author:
Lucian Chirita ([email protected])

Field Summary
protected static java.lang.String PACKAGE_PREFIX_SUN_XERCES
           
protected static java.lang.String PACKAGE_PREFIX_XERCES
           
protected static java.lang.String POOL_CLASS_SUN_XERCES
           
protected static java.lang.String POOL_CLASS_XERCES
           
static java.lang.String PROPERTY_CACHE_SCHEMAS
          A property that determines whether XML schemas/grammars are to be cached so that they are not read/initialized each time a report is compiled.
protected static java.lang.String XERCES_PARSER_PROPERTY_GRAMMAR_POOL
           
 
Fields inherited from interface net.sf.jasperreports.engine.xml.JRSaxParserFactory
PROPERTY_REPORT_PARSER_FACTORY
 
Constructor Summary
JRReportSaxParserFactory()
           
 
Method Summary
protected  void configureParser(javax.xml.parsers.SAXParser parser)
           
 javax.xml.parsers.SAXParser createParser()
          Creates a SAX parser.
protected  javax.xml.parsers.SAXParserFactory createSAXParserFactory()
           
protected  void enableSchemaCaching(javax.xml.parsers.SAXParser parser)
           
protected  java.lang.Object getGrammarPoolCacheKey()
           
protected  java.lang.String getResourceURI(java.lang.String resource)
           
protected  java.util.List getSchemaLocations()
           
protected  void setGrammarPoolProperty(javax.xml.parsers.SAXParser parser, java.lang.String poolClassName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CACHE_SCHEMAS

public static final java.lang.String PROPERTY_CACHE_SCHEMAS
A property that determines whether XML schemas/grammars are to be cached so that they are not read/initialized each time a report is compiled.

Currently, setting this property is only effective when a Xerces XML parser is used (either a stock one from Apache or one embedded into a SUN JDK).

See Also:
Constant Field Values

PACKAGE_PREFIX_XERCES

protected static final java.lang.String PACKAGE_PREFIX_XERCES
See Also:
Constant Field Values

POOL_CLASS_XERCES

protected static final java.lang.String POOL_CLASS_XERCES
See Also:
Constant Field Values

PACKAGE_PREFIX_SUN_XERCES

protected static final java.lang.String PACKAGE_PREFIX_SUN_XERCES
See Also:
Constant Field Values

POOL_CLASS_SUN_XERCES

protected static final java.lang.String POOL_CLASS_SUN_XERCES
See Also:
Constant Field Values

XERCES_PARSER_PROPERTY_GRAMMAR_POOL

protected static final java.lang.String XERCES_PARSER_PROPERTY_GRAMMAR_POOL
See Also:
Constant Field Values
Constructor Detail

JRReportSaxParserFactory

public JRReportSaxParserFactory()
Method Detail

createParser

public javax.xml.parsers.SAXParser createParser()
Description copied from interface: JRSaxParserFactory
Creates a SAX parser.

Specified by:
createParser in interface JRSaxParserFactory
Returns:
the created parser

createSAXParserFactory

protected javax.xml.parsers.SAXParserFactory createSAXParserFactory()
                                                             throws javax.xml.parsers.ParserConfigurationException,
                                                                    org.xml.sax.SAXException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

configureParser

protected void configureParser(javax.xml.parsers.SAXParser parser)
                        throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getSchemaLocations

protected java.util.List getSchemaLocations()

getResourceURI

protected java.lang.String getResourceURI(java.lang.String resource)

enableSchemaCaching

protected void enableSchemaCaching(javax.xml.parsers.SAXParser parser)

setGrammarPoolProperty

protected void setGrammarPoolProperty(javax.xml.parsers.SAXParser parser,
                                      java.lang.String poolClassName)

getGrammarPoolCacheKey

protected java.lang.Object getGrammarPoolCacheKey()


Copyright © 2011. All Rights Reserved.