Examples of DOMForest


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

                    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

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

    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

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

                    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

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

    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

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

    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

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

    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

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

    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

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

    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

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

     */
    public DOMForest buildDOMForest( InternalizationLogic logic )
        throws SAXException {
   
        // parse into DOM forest
        DOMForest forest = new DOMForest(logic);
       
        forest.setErrorHandler(errorReceiver);
        if(opt.entityResolver!=null)
        forest.setEntityResolver(opt.entityResolver);
       
        // parse source grammars
        for (InputSource value : opt.getGrammars()) {
            errorReceiver.pollAbort();
            forest.parse(value, true);
        }
       
        // parse external binding files
        for (InputSource value : opt.getBindFiles()) {
            errorReceiver.pollAbort();
            Document dom = forest.parse(value, true);
            if(dom==null)       continue;   // error must have been reported
            Element root = dom.getDocumentElement();
            // TODO: it somehow doesn't feel right to do a validation in the Driver class.
            // think about moving it to somewhere else.
            if (!fixNull(root.getNamespaceURI()).equals(Const.JAXB_NSURI)
                    || !root.getLocalName().equals("bindings"))
                errorReceiver.error(new SAXParseException(Messages.format(Messages.ERR_NOT_A_BINDING_FILE,
                        root.getNamespaceURI(),
                        root.getLocalName()),
                        null,
                        value.getSystemId(),
                        -1, -1));
        }

        scdBasedBindingSet = forest.transform(opt.isExtensionMode());

        return forest;
    }
View Full Code Here

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

            }
        }

        // the default slower way is to parse everything into DOM first.
        // so that we can take external annotations into account.
        DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
        return createXSOM(forest, scdBasedBindingSet);
    }
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.