Package org.xml.sax

Examples of org.xml.sax.EntityResolver


        InputStream stream = new AddDTDFilterInputStream(URLHandlerRegistry.getDefault()
                .openStream(descriptorURL));
        InputSource source = new InputSource(stream);
        source.setSystemId(XMLHelper.toSystemId(descriptorURL));
        try {
            Document pomDomDoc = XMLHelper.parseToDom(source, new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId)
                        throws SAXException, IOException {
                    if ((systemId != null) && systemId.endsWith("m2-entities.ent")) {
                        return new InputSource(PomReader.class
                                .getResourceAsStream("m2-entities.ent"));
View Full Code Here


               return source;
            }
         }

         // first try to resolve using user's entity resolver
         EntityResolver resolver = fEntityHandler.getEntityResolver();
         if (resolver != null) {
            InputSource source = resolver.resolveEntity(publicId, systemId);
            if (source != null) {
               return source;
            }
         }
View Full Code Here

                e.printStackTrace();
              }
          }
         // expand it before passing it to the parser
         InputSource source = null;
         EntityResolver currentER = fSchemaGrammarParser.getEntityResolver();
         if (currentER != null) {
            source = currentER.resolveEntity("", loc);
         }
         if (source == null) {
            loc = fEntityHandler.expandSystemId(loc);
            source = new InputSource(loc);
         }
View Full Code Here

            e.printStackTrace();
         }

         // expand it before passing it to the parser
         InputSource source = null;
         EntityResolver currentER = parser.getEntityResolver();
         if (currentER != null) {
            source = currentER.resolveEntity("", loc);
         }
         if (source == null) {
            loc = fEntityHandler.expandSystemId(loc);
            source = new InputSource(loc);
         }
View Full Code Here

               return source;
            }
         }

         // first try to resolve using user's entity resolver
         EntityResolver resolver = fEntityHandler.getEntityResolver();
         if (resolver != null) {
            InputSource source = resolver.resolveEntity(publicId, systemId);
            if (source != null) {
               return source;
            }
         }
View Full Code Here

      debug.message(1, "Cannot read SAX catalog without a parser");
      throw new CatalogException(CatalogException.UNPARSEABLE);
    }

    debug = catalog.getCatalogManager().debug;
    EntityResolver bResolver = catalog.getCatalogManager().getBootstrapResolver();

    this.catalog = catalog;

    try {
      if (parserFactory != null) {
View Full Code Here

    private static SaxLoader getSaxLoader(XmlOptions options)
    {
        options = XmlOptions.maskNull(options);

        EntityResolver er = null;

        if (!options.hasOption(XmlOptions.LOAD_USE_DEFAULT_RESOLVER))
        {
            er = (EntityResolver) options.get(XmlOptions.ENTITY_RESOLVER);
View Full Code Here

                    urls.add(file.toURL());
                    System.out.println("Adding to classpath: " + file);
                }
            }
            ClassLoader cl = new URLClassLoader((URL[]) urls.toArray(new URL[] {}));
            EntityResolver entityResolver = null;
            if (catalogLocation != null) {
                CatalogManager catalogManager = CatalogManager.getStaticManager();
                catalogManager.setCatalogFiles(catalogLocation);
                entityResolver = new CatalogResolver();
            }
View Full Code Here

            documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            documentBuilderFactory.setExpandEntityReferences(false);
            documentBuilder = documentBuilderFactory.newDocumentBuilder();
            documentBuilder.setEntityResolver
                (new EntityResolver() {
                    public InputSource resolveEntity(String publicId, String systemId)
                        throws SAXException, IOException {
                        return new InputSource(new StringReader(""));
                    }
                });
View Full Code Here

      InputStream in = URLToStreamHelper.urlToStream(resourceConfig);
      try {
        Digester digester = new Digester();
        digester.setValidating(false);
        digester.setEntityResolver(new EntityResolver() {
          // Dummi resolver - alvays do nothing
          public InputSource resolveEntity(String publicId,
              String systemId) throws SAXException, IOException {
            return new InputSource(new StringReader(""));
          }
View Full Code Here

TOP

Related Classes of org.xml.sax.EntityResolver

Copyright © 2018 www.massapicom. 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.