Package org.exolab.castor.xml.schema

Examples of org.exolab.castor.xml.schema.ElementDecl


        _schema.addComplexType(cType);

        Group group = new Group();
        cType.addGroup(group);

        ElementDecl e = new ElementDecl(_schema);
        e.setName("myAttr");
        group.addElementDecl(e);

        // compare
        TestResult result = doTest("complextype_singleattribute.xsd");
        assertEquals("single attribute test failed", TestResult.IDENTICAL,
View Full Code Here


        _schema.addComplexType(cType);

        Group group = new Group();
        cType.addGroup(group);

        ElementDecl e = new ElementDecl(_schema);
        e.setName("myAttr");
        group.addElementDecl(e);

        ElementDecl e2 = new ElementDecl(_schema);
        e2.setName("myAttr2");
        group.addElementDecl(e2);

        ElementDecl e3 = new ElementDecl(_schema);
        e3.setName("myAttr3");
        group.addElementDecl(e3);

        // compare
        TestResult result = doTest("complextype_sequenceattribute.xsd");
        assertEquals("sequence multiple attributes test failed",
View Full Code Here

        Group group = new Group();
        group.setOrder(Order.all);
        cType.addGroup(group);

        ElementDecl e = new ElementDecl(_schema);
        e.setName("myAttr");
        group.addElementDecl(e);

        ElementDecl e2 = new ElementDecl(_schema);
        e2.setName("myAttr2");
        group.addElementDecl(e2);

        ElementDecl e3 = new ElementDecl(_schema);
        e3.setName("myAttr3");
        group.addElementDecl(e3);

        // compare
        TestResult result = doTest("complextype_allorder.xsd");
        assertEquals("all order attributes test failed", TestResult.IDENTICAL,
View Full Code Here

        Group group = new Group();
        group.setOrder(Order.choice);
        cType.addGroup(group);

        ElementDecl e = new ElementDecl(_schema);
        e.setName("myAttr");
        group.addElementDecl(e);

        ElementDecl e2 = new ElementDecl(_schema);
        e2.setName("myAttr2");
        group.addElementDecl(e2);

        ElementDecl e3 = new ElementDecl(_schema);
        e3.setName("myAttr3");
        group.addElementDecl(e3);

        // compare
        TestResult result = doTest("complextype_choiceattribute.xsd");
        assertEquals("choice group attributes test failed",
View Full Code Here

        _schema.addComplexType(cBaseType);

        Group gBase = new Group();
        cBaseType.addGroup(gBase);

        ElementDecl ebase = new ElementDecl(_schema);
        ebase.setName("baseAttr");
        gBase.addElementDecl(ebase);

        // create dependency
        ComplexType cType = _schema.createComplexType("myType");
        _schema.addComplexType(cType);
        cType.setBaseType(cBaseType);
        cType.setDerivationMethod(SchemaNames.EXTENSION);

        Group group = new Group();
        cType.addGroup(group);

        ElementDecl e = new ElementDecl(_schema);
        e.setName("myAttr");
        group.addElementDecl(e);

        ElementDecl e2 = new ElementDecl(_schema);
        e2.setName("myAttr2");
        group.addElementDecl(e2);

        // compare
        TestResult result = doTest("complextype_attributeorder.xsd");
        assertEquals("create extension test failed", TestResult.IDENTICAL,
View Full Code Here

        _schema.addComplexType(cType);

        Group group = new Group();
        cType.addGroup(group);

        ElementDecl e = new ElementDecl(_schema);
        e.setName("myAttr");
        group.addElementDecl(e);

        ElementDecl element = new ElementDecl(_schema);
        element.setName("myElement");
        element.setTypeReference("myType");
        _schema.addElementDecl(element);

        // compare
        TestResult result = doTest("complextype_elementforcomplextype.xsd");
        assertEquals("test create element for complexType test failed",
View Full Code Here

            simpleType = ((SimpleTypeUnmarshaller) _unmarshaller).getSimpleType();
            _schema.addSimpleType(simpleType);
            getResolver().addResolvable(simpleType.getReferenceId(), simpleType);
        } else if (name.equals(SchemaNames.ELEMENT)) {
            //--<element>
            ElementDecl element = null;
            element = ((ElementUnmarshaller) _unmarshaller).getElement();
            _schema.addElementDecl(element);
        } else if (name.equals(SchemaNames.GROUP)) {
            //--<group>
            ModelGroup group = null;
View Full Code Here

    throws XMLException {
        super(schemaContext);

        this._schema = schema;

        _element = new ElementDecl(schema);
       
        String attValue = null;
       
        //-- @ref
        attValue = atts.getValue(SchemaNames.REF_ATTR);
View Full Code Here

            }
            else {
                group = (Group) type.getParticle(0);
                //-- check for another element declaration with
                //-- same name ...
                ElementDecl element = group.getElementDecl(name);
                boolean checkGroupType = false;
                if (element != null) {
                    //-- if complex...merge definition
                    if (sInfo.complex) {
                        try {
                            merge(element, sInfo.element);
                        }
                        catch(SchemaException sx) {
                            throw new SAXException(sx);
                        }
                    }
                    element.setMaxOccurs(Particle.UNBOUNDED);
                    checkGroupType = true;
                }
                else {
                    try {
                        group.addElementDecl(sInfo.element);
View Full Code Here

        sInfo = new StateInfo();
        sInfo.topLevel = topLevel;
        _siStack.push(sInfo);
       
        //-- create element definition
        sInfo.element = new ElementDecl(_schema, name);
       
        //-- create attributes
        for (int i = 0; i < atts.getLength(); i++) {
           
            String attName = atts.getName(i);
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.ElementDecl

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.