Package com.sun.tools.xjc.reader.internalizer

Examples of com.sun.tools.xjc.reader.internalizer.DOMForest


            if( opt.mode==Mode.FOREST ) {
                // dump DOM forest and quit
                ModelLoader loader  = new ModelLoader( opt, new JCodeModel(), receiver );
                try {
                    DOMForest forest = loader.buildDOMForest(new XMLSchemaInternalizationLogic());
                    forest.dump(System.out);
                    return 0;
                } catch (SAXException e) {
                    // the error should have already been reported
                } catch (IOException e) {
                    receiver.error(e);
View Full Code Here


    public void setClassNameAllocator(ClassNameAllocator allocator) {
        opts.classNameAllocator = allocator;
    }

    public void resetSchema() {
        forest = new DOMForest(new XMLSchemaInternalizationLogic());
        forest.setErrorHandler(this);
        forest.setEntityResolver(opts.entityResolver);
    }
View Full Code Here

                    return new ReferenceFinder(parent, catalog);
                }
            };
           
            Constructor<DOMForest> c = null;
            DOMForest forest = null;

            try {
                c = DOMForest.class.getConstructor(InternalizationLogic.class, Options.class);
                forest = c.newInstance(logic, opts);
            } catch (Throwable t) {
                c = DOMForest.class.getConstructor(InternalizationLogic.class);
                forest = c.newInstance(logic);
            }
            forest.setErrorHandler((ErrorReceiver)schemaCompiler);
            f.set(schemaCompiler, forest);
        } catch (Throwable ex)  {
            //ignore
        }
    }
View Full Code Here

  /**
   * Return values of all {@code <jaxb:class ref="..." />} attributes.
   */
  private Set<String> getClassReferencesFromEpisodeFile(String episodeFile) throws SAXException {
    DOMForest forest = new DOMForest(new XMLSchemaInternalizationLogic(), new Options());

    Document episodeDocument = forest.parse(new InputSource(episodeFile), true);

    NodeList nodeList = episodeDocument.getElementsByTagNameNS(Const.JAXB_NSURI, "class");
    Set<String> classReferences = new HashSet<String>();

    for (int i = 0, len = nodeList.getLength(); i < len; i++) {
View Full Code Here

    public void setClassNameAllocator(ClassNameAllocator allocator) {
        opts.classNameAllocator = allocator;
    }

    public void resetSchema() {
        forest = new DOMForest(new XMLSchemaInternalizationLogic());
        forest.setErrorHandler(this);
        forest.setEntityResolver(opts.entityResolver);
    }
View Full Code Here

            if( opt.mode==Mode.FOREST ) {
                // dump DOM forest and quit
                ModelLoader loader  = new ModelLoader( opt, new JCodeModel(), receiver );
                try {
                    DOMForest forest = loader.buildDOMForest(new XMLSchemaInternalizationLogic());
                    forest.dump(System.out);
                    return 0;
                } catch (SAXException e) {
                    // the error should have already been reported
                } catch (IOException e) {
                    receiver.error(e);
View Full Code Here

            if( opt.mode==Mode.FOREST ) {
                // dump DOM forest and quit
                ModelLoader loader  = new ModelLoader( opt, new JCodeModel(), receiver );
                try {
                    DOMForest forest = loader.buildDOMForest(new XMLSchemaInternalizationLogic());
                    forest.dump(System.out);
                    return 0;
                } catch (SAXException e) {
                    // the error should have already been reported
                } catch (IOException e) {
                    receiver.error(e);
View Full Code Here

    private void hackInNewInternalizationLogic(SchemaCompiler schemaCompiler,
                                               final OASISCatalogManager catalog) {
        try {
            Field f = schemaCompiler.getClass().getDeclaredField("forest");
            f.setAccessible(true);
            DOMForest forest = new DOMForest(new XMLSchemaInternalizationLogic() {
                public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
                    return new ReferenceFinder(parent, catalog);
                }

            });
            forest.setErrorHandler((ErrorReceiver)schemaCompiler);
            f.set(schemaCompiler, forest);
        } catch (Throwable ex)  {
            //ignore
        }
    }
View Full Code Here

                    return new ReferenceFinder(parent, catalog);
                }
            };
           
            Constructor<DOMForest> c = null;
            DOMForest forest = null;

            try {
                c = DOMForest.class.getConstructor(InternalizationLogic.class, Options.class);
                forest = c.newInstance(logic, opts);
            } catch (Throwable t) {
                c = DOMForest.class.getConstructor(InternalizationLogic.class);
                forest = c.newInstance(logic);
            }
            forest.setErrorHandler((ErrorReceiver)schemaCompiler);
            f.set(schemaCompiler, forest);
        } catch (Throwable ex)  {
            //ignore
        }
    }
View Full Code Here

    private void hackInNewInternalizationLogic(SchemaCompiler schemaCompiler,
                                               final OASISCatalogManager catalog) {
        try {
            Field f = schemaCompiler.getClass().getDeclaredField("forest");
            f.setAccessible(true);
            DOMForest forest = new DOMForest(new XMLSchemaInternalizationLogic() {
                public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
                    return new ReferenceFinder(parent, catalog);
                }

            });
            forest.setErrorHandler((ErrorReceiver)schemaCompiler);
            f.set(schemaCompiler, forest);
        } catch (Throwable ex)  {
            //ignore
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.xjc.reader.internalizer.DOMForest

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.