net.sf.jasperreports.engine.xml

## Class BaseSaxParserFactory

- java.lang.Object
- - net.sf.jasperreports.engine.xml.BaseSaxParserFactory

- All Implemented Interfaces:
    JRSaxParserFactory
  Direct Known Subclasses:
    JRReportSaxParserFactory, PrintSaxParserFactory

      public abstract class BaseSaxParserFactory
      extends java.lang.Object
      implements JRSaxParserFactory

  Base SAX parser factory.

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

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

  Version:
    $Id: BaseSaxParserFactory.java 6863 2014-02-06 09:59:27Z teodord $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `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_PRINT_PARSER_FACTORY, PROPERTY_REPORT_PARSER_FACTORY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseSaxParserFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 abstract java.util.List<java.lang.String>` | `getSchemaLocations()`
    `protected abstract boolean` | `isValidating()`
    `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

    - #### BaseSaxParserFactory

          public BaseSaxParserFactory()

  - ### 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`

    - #### isValidating

          protected abstract boolean isValidating()

    - #### configureParser

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

      Throws:
        `org.xml.sax.SAXException`

    - #### getSchemaLocations

          protected abstract java.util.List<java.lang.String> 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()

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com