Java Code Examples for jdk.xml.internal.JdkXmlUtils#getSAXFactory()

The following examples show how to use jdk.xml.internal.JdkXmlUtils#getSAXFactory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Resolver.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 2
Source File: Resolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 3
Source File: Catalog.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 4
Source File: Resolver.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 5
Source File: Catalog.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 6
Source File: Resolver.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.ExtendedXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 7
Source File: Catalog.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Setup readers.
 */
public void setupReaders() {
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(false);

  SAXCatalogReader saxReader = new SAXCatalogReader(spf);

  saxReader.setCatalogParser(null, "XMLCatalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.XCatalogReader");

  saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName,
                             "catalog",
                             "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");

  addReader("application/xml", saxReader);

  TR9401CatalogReader textReader = new TR9401CatalogReader();
  addReader("text/plain", textReader);
}
 
Example 8
Source File: ResolvingXMLReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 9
Source File: ResolvingParser.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 10
Source File: ResolvingXMLReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 11
Source File: ResolvingXMLReader.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 12
Source File: ResolvingXMLReader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 13
Source File: ResolvingParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 14
Source File: ResolvingXMLReader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 15
Source File: ResolvingParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 16
Source File: ResolvingXMLReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader() {
  super();
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 17
Source File: ResolvingXMLReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a new reader from the JAXP factory.
 *
 * <p>In order to do its job, a ResolvingXMLReader must in fact be
 * a filter. So the only difference between this code and the filter
 * code is that the constructor builds a new reader.</p>
 */
public ResolvingXMLReader(CatalogManager manager) {
  super(manager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);
  try {
    SAXParser parser = spf.newSAXParser();
    setParent(parser.getXMLReader());
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 18
Source File: ResolvingParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Initialize the parser. */
private void initParser() {
  catalogResolver = new CatalogResolver(catalogManager);
  SAXParserFactory spf = JdkXmlUtils.getSAXFactory(catalogManager.overrideDefaultParser());
  spf.setValidating(validating);

  try {
    saxParser = spf.newSAXParser();
    parser = saxParser.getParser();
    documentHandler = null;
    dtdHandler = null;
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
Example 19
Source File: XMLCatalogResolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Attaches the reader to the catalog.
 */
private void attachReaderToCatalog (Catalog catalog) {

    SAXParserFactory spf = JdkXmlUtils.getSAXFactory(
            catalog.getCatalogManager().overrideDefaultParser());
    spf.setValidating(false);

    SAXCatalogReader saxReader = new SAXCatalogReader(spf);
    saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
        "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
    catalog.addReader("application/xml", saxReader);
}
 
Example 20
Source File: XMLCatalogResolver.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Attaches the reader to the catalog.
 */
private void attachReaderToCatalog (Catalog catalog) {

    SAXParserFactory spf = JdkXmlUtils.getSAXFactory(
            catalog.getCatalogManager().overrideDefaultParser());
    spf.setValidating(false);

    SAXCatalogReader saxReader = new SAXCatalogReader(spf);
    saxReader.setCatalogParser(OASISXMLCatalogReader.namespaceName, "catalog",
        "com.sun.org.apache.xml.internal.resolver.readers.OASISXMLCatalogReader");
    catalog.addReader("application/xml", saxReader);
}