Package javax.xml.parsers

Examples of javax.xml.parsers.DocumentBuilder.reset()


      DocumentBuilder docBuilder = _builderFactory.newDocumentBuilder();

      while (urls.hasMoreElements()) {
        URL url = urls.nextElement();
        try {
          docBuilder.reset();
          Document doc = docBuilder.parse(url.toString());
          String frameworkName = xp_bundleName.evaluate(doc);
          if ("WebObjects Framework".equals(frameworkName)) {
            return xp_bundleVersion.evaluate(doc);
          }
View Full Code Here


            if (this.canResetParsers) {
                try {
                    /*
                     * Reset the parser so that it can be used again.
                     */
                    docBuilder.reset();
                } catch (final UnsupportedOperationException ignored) {
                    if (this.logger.isWarnEnabled()) {
                        this.logger.warn(
                                "[THYMELEAF] The DOM Parser implementation being used (\"{}\") does not implement " +
                                    "the \"reset\" operation. This will force Thymeleaf to re-create parser instances " +
View Full Code Here

   */
  private static DocumentBuilder getBuilder() throws ParserConfigurationException {
    DocumentBuilder builder;
    if (canReuseBuilders) {
      builder = REUSABLE_BUILDER.get();
      builder.reset();
    } else {
      builder = BUILDER_FACTORY.newDocumentBuilder();
    }
    builder.setErrorHandler(ERROR_HANDLER);
    return builder;
View Full Code Here

   */
  private static DocumentBuilder getBuilder() throws ParserConfigurationException {
    DocumentBuilder builder;
    if (canReuseBuilders) {
      builder = reusableBuilder.get();
      builder.reset();
    } else {
      builder = builderFactory.newDocumentBuilder();
    }
    builder.setErrorHandler(errorHandler);
    return builder;
View Full Code Here

                DocumentBuilder db = dbf.newDocumentBuilder();
               
                // Parse, reset the parser and then parse again.
                db.setErrorHandler(parserAPIUsage);
                db.parse(docURI);
                db.reset();
                db.setErrorHandler(parserAPIUsage);
                db.parse(docURI);
            }
            // "sax".equals(apiToUse)
            else {
View Full Code Here

                DocumentBuilder db = dbf.newDocumentBuilder();
               
                // Parse, reset the parser and then parse again.
                db.setErrorHandler(parserAPIUsage);
                db.parse(docURI);
                db.reset();
                db.setErrorHandler(parserAPIUsage);
                db.parse(docURI);
            }
            // "sax".equals(apiToUse)
            else {
View Full Code Here

   */
  private static DocumentBuilder getBuilder() throws ParserConfigurationException {
    DocumentBuilder builder;
    if (canReuseBuilders) {
      builder = reusableBuilder.get();
      builder.reset();
    } else {
      builder = builderFactory.newDocumentBuilder();
    }
    builder.setErrorHandler(errorHandler);
    return builder;
View Full Code Here

    public static Document parse(String uri) throws TransformerException, IOException, SAXException, ParserConfigurationException {
        DocumentBuilder db = documentBuilder();
        try {
            return db.parse(uri);
        } finally {
            db.reset();
        }
    }

    public static Document parse(InputStream stream) throws TransformerException, IOException, SAXException, ParserConfigurationException {
        DocumentBuilder db = documentBuilder();
View Full Code Here

    public static Document parse(InputStream stream) throws TransformerException, IOException, SAXException, ParserConfigurationException {
        DocumentBuilder db = documentBuilder();
        try {
            return db.parse(stream);
        } finally {
            db.reset();
        }
    }

    public static Document parse(File f) throws TransformerException, IOException, SAXException, ParserConfigurationException {
        DocumentBuilder db = documentBuilder();
View Full Code Here

    public static Document parse(File f) throws TransformerException, IOException, SAXException, ParserConfigurationException {
        DocumentBuilder db = documentBuilder();
        try {
            return db.parse(f);
        } finally {
            db.reset();
        }
    }

    public static Document parse(File f, ErrorHandler errorHandler) throws TransformerException, IOException, SAXException, ParserConfigurationException {
        DocumentBuilder db = documentBuilder();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.