Package com.sun.tools.txw2

Examples of com.sun.tools.txw2.XmlSchemaLoader


    private XmlSchemaBuilder(XSSchemaSet xs,TxwOptions opts) {
        this.schemaSet = xs;
        grammar.addChild(new Empty(null));
        this.nodeSet = new NodeSet(opts,grammar);
        this.dtf = new DatatypeFactory(opts.codeModel);
    }
View Full Code Here


    public RELAXNGLoader(Parseable parseable) {
        this.parseable = parseable;
    }

    public NodeSet build(TxwOptions options) throws IllegalSchemaException {
        SchemaBuilderImpl stage1 = new SchemaBuilderImpl(options.codeModel);
        DatatypeLibraryLoader loader = new DatatypeLibraryLoader(getClass().getClassLoader());
        Leaf pattern = (Leaf)parseable.parse(new CheckingSchemaBuilder(stage1,options.errorListener,
            new CascadingDatatypeLibraryFactory(
                new BuiltinDatatypeLibraryFactory(loader),loader)));
View Full Code Here

    public Leaf empty(XSContentType empty) {
        return new Empty(empty.getLocator());
    }

    public Attribute attributeDecl(XSAttributeDecl decl) {
        return new Attribute(decl.getLocator(),
                        getQName(decl),
                        simpleType(decl.getType()));
    }
View Full Code Here

    }

    public Leaf makeAttribute(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
        Leaf r = null;
        for( QName n : nameClass.listNames() ) {
            Leaf l = new Attribute(locator,n,leaf);
            if(r!=null)     r = r.merge(l);
            else            r = l;
        }
        if(r==null)     return new Empty(locator);
        return r;
View Full Code Here

        return t.getName().equals("anyType") && t.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema");
    }

    public Leaf restrictionSimpleType(XSRestrictionSimpleType rst) {
        JType t = dtf.getType(rst.getTargetNamespace(),rst.getName());
        if(t!=null) return new Data(rst.getLocator(),t);
        return simpleType(rst.getSimpleBaseType());
    }
View Full Code Here

    public DataPatternBuilderImpl(JType type) {
        this.type = type;
    }

    public Leaf makePattern(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
        return new Data(locator,type);
    }
View Full Code Here

    public Leaf makeList(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
        return new List(locator,leaf);
    }

    public Leaf makeMixed(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
        return leaf.merge(new Data(locator,string));
    }
View Full Code Here

        // able to handle <notAllowed/> correctly anyway.
        return new Empty(locator);
    }

    public Leaf makeText(LocatorImpl locator, AnnotationsImpl annotations) {
        return new Data(locator,string);
    }
View Full Code Here

        // no need to generate anything for this.
        return new Empty(wc.getLocator());
    }

    public Leaf modelGroupDecl(XSModelGroupDecl mg) {
        Define def = modelGroups.get(mg);
        if(def==null) {
            def = grammar.get(mg.getName()); // TODO: name collision detection and avoidance
            modelGroups.put(mg,def);

            def.addChild(mg.getModelGroup().apply(this));
        }
        return new Ref(mg.getLocator(),def);
    }
View Full Code Here

        nodeSet.add(el);
        return el;
    }

    public Leaf complexType(XSComplexType ct) {
        Define def = complexTypes.get(ct);
        if(def==null) {
            // TODO: consider name collision and such
            String name = ct.getName();
            if(ct.isLocal()) {
                name = ct.getScope().getName();
            }
            def = grammar.get(name);
            complexTypes.put(ct,def);

            XSType baseType = ct.getBaseType();
            if(baseType.isComplexType() && !isAnyType(baseType)) {
                // copy inheritance
                def.addChild(baseType.apply(this));

                if(ct.getDerivationMethod()==XSType.EXTENSION) {
                    XSContentType explicitContent = ct.getExplicitContent();
                    if(explicitContent!=null)
                        def.addChild(explicitContent.apply(this));
                    attHolder(ct, def);
                }
            } else {
                // just start from fresh
                def.addChild(ct.getContentType().apply(this));
                attHolder(ct, def);
            }
        }

        return new Ref(ct.getLocator(),def);
View Full Code Here

TOP

Related Classes of com.sun.tools.txw2.XmlSchemaLoader

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.