Examples of ElementDecl


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

        subgroup.setMinOccurs(0);
        subgroup.setMaxOccurs(Particle.UNBOUNDED);
        group.addGroup(subgroup);

        // create an element for choice
        ElementDecl elem = new ElementDecl(_schema);
        elem.setName("myStringType");
        elem.setTypeReference("string");
        subgroup.addElementDecl(elem);

        // create a choice element for sequence element
        subgroup = new Group();
        subgroup.setOrder(Order.choice);
        subgroup.setMinOccurs(0);
        subgroup.setMaxOccurs(Particle.UNBOUNDED);
        group.addGroup(subgroup);

        // create an element for choice
        elem = new ElementDecl(_schema);
        elem.setName("myStringType2");
        elem.setTypeReference("string");
        subgroup.addElementDecl(elem);
        // compare
        TestResult result = doTest("group_2subgroups.xsd");
        assertEquals("single attribute test failed", TestResult.IDENTICAL,
                result);
View Full Code Here

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

       
        if (a1 != null) {
            message.append(SchemaNames.getStructureName(a1));
            message.append(" '");
            if (a1 instanceof ElementDecl) {
                ElementDecl element = (ElementDecl) a1;
                annotated1XPath = XPathHelper.getSchemaLocation(a1) + "[/complexType:"
                + element.getType().getName() + "]";
                message.append(annotated1XPath);
            } else {
                message.append(XPathHelper.getSchemaLocation(a1));
            }
        } else {
            if (newClassInfo.hasNature(XMLInfoNature.class.getName())) {
                XMLInfoNature xmlNature = new XMLInfoNature(newClassInfo);
                message.append(xmlNature.getNodeTypeName());
                message.append(" '");
                message.append(xmlNature.getNodeName());
            }
        }
        message.append("' and ");
        if (a2 != null) {
            message.append(SchemaNames.getStructureName(a2));
            message.append(" '");
            if (a2 instanceof ElementDecl) {
                ElementDecl element = (ElementDecl) a2;
                annotated2XPath = XPathHelper.getSchemaLocation(a2) + "[/complexType:"
                + element.getType().getName() + "]";
                message.append(annotated2XPath);
            } else {
                message.append(XPathHelper.getSchemaLocation(a2));
            }
        } else {
View Full Code Here

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

            //-- created from element definition information
            xmlNature.setElementDefinition(creatingForAnElement);
           
            // deal with substitution groups
            if (creatingForAnElement) {
                ElementDecl elementDeclaration = (ElementDecl) component.getAnnotated();
                Enumeration<ElementDecl> possibleSubstitutes = elementDeclaration.getSubstitutionGroupMembers();
                if (possibleSubstitutes.hasMoreElements()) {
                    List<String> substitutionGroupMembers = new ArrayList<String>();
                    while (possibleSubstitutes.hasMoreElements()) {
                        ElementDecl substitute = possibleSubstitutes.nextElement();
                        substitutionGroupMembers.add(substitute.getName());
                    }
                    xmlNature.setSubstitutionGroups(substitutionGroupMembers);
                }
            }
View Full Code Here

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

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);

        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

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

        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

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

        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

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

        _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

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);

        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

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

            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
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.