Examples of XmlSchemaObject


Examples of org.apache.ws.commons.schema.XmlSchemaObject

            return;
        }
           
        XmlSchemaObjectCollection inc = schema.getIncludes();
        for (int x = 0; x < inc.getCount(); x++) {
            XmlSchemaObject what = inc.getItem(x);
            if (what instanceof XmlSchemaImport) {
                XmlSchemaImport imp = (XmlSchemaImport)what;
                // already there.
                if (namespaceUri.equals(imp.getNamespace())) {
                    return;
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

    private void addOneSchemaCrossImports(XmlSchema schema) {
        /*
         * We need to visit all the top-level items.
         */
        for (int x = 0; x < schema.getItems().getCount(); x++) {
            XmlSchemaObject item = schema.getItems().getItem(x);
            if (item instanceof XmlSchemaElement) {
                addElementCrossImportsElement(schema, item);
            } else if (item instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute attr = (XmlSchemaAttribute)item;
                XmlSchemaUtils.addImportIfNeeded(schema, attr.getRefName());
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

    }

    private void addCrossImportsSequence(XmlSchema schema, XmlSchemaSequence sequence) {
        XmlSchemaObjectCollection items = sequence.getItems();
        for (int x = 0; x < items.getCount(); x++) {
            XmlSchemaObject seqItem = items.getItem(x);
            if (seqItem instanceof XmlSchemaElement) {
                addElementCrossImportsElement(schema, seqItem);
            }
        }
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

                                             boolean allowRefs) {
        XmlSchemaObjectCollection items = seq.getItems();
        boolean ret = true;

        for (int i = 0; i < items.getCount(); i++) {
            XmlSchemaObject seqItem = items.getItem(i);
            if (!(seqItem instanceof XmlSchemaElement)) {
                return false;
            }
            XmlSchemaElement el = (XmlSchemaElement)seqItem;
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

            }
            XmlSchemaSequence sequence = (XmlSchemaSequence)complexType.getParticle();
            XmlSchemaObjectCollection items = sequence.getItems();
            List<XmlSchemaElement> childElements = new ArrayList<XmlSchemaElement>();
            for (int i = 0; i < items.getCount(); i++) {
                XmlSchemaObject schemaObject = items.getItem(i);
                if (!(schemaObject instanceof XmlSchemaElement)) {
                    // Should contain elements only
                    return null;
                }
                XmlSchemaElement childElement = (XmlSchemaElement)schemaObject;
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

        return true;
    }

    public static <T extends XmlSchemaObject> T getXmlSchemaObject(XmlSchema schema, QName name, Class<T> type) {
        if (schema != null) {
            XmlSchemaObject object = null;
            if (type == XmlSchemaElement.class) {
                object = schema.getElementByName(name);
            } else if (type == XmlSchemaType.class) {
                object = schema.getTypeByName(name);
            }
            if (object != null) {
                return type.cast(object);
            }
            for (Iterator i = schema.getIncludes().getIterator(); i.hasNext();) {
                XmlSchemaObject obj = (XmlSchemaObject)i.next();
                XmlSchema ext = null;
                if (obj instanceof XmlSchemaInclude) {
                    ext = ((XmlSchemaInclude)obj).getSchema();
                }
                if (obj instanceof XmlSchemaImport) {
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

        XmlSchemaObjectTable schemaTypes = schema.getSchema().getSchemaTypes();
        Iterator namesIterator = schemaTypes.getNames();
        while (namesIterator.hasNext()) {
            QName name = (QName)namesIterator.next();
            XmlSchemaObject xmlSchemaObject = (XmlSchemaObject)schemaTypes.getItem(name);
            if (xmlSchemaObject instanceof XmlSchemaComplexType) {
                try {
                    XmlSchemaComplexType complexType = (XmlSchemaComplexType)xmlSchemaObject;
                    if (!JavascriptUtils.notVeryComplexType(complexType)
                        && complexType.getName() != null) {
                        complexTypeConstructorAndAccessors(complexType.getQName(), complexType);
                        complexTypeSerializerFunction(complexType.getQName(), complexType);
                        domDeserializerFunction(complexType.getQName(), complexType);
                    }
                } catch (UnsupportedConstruct usc) {
                    LOG.warning(usc.toString());
                    continue; // it could be empty, but the style checker
                    // would complain.
                }
            } else if (xmlSchemaObject instanceof XmlSchemaSimpleType) {
                XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)xmlSchemaObject;
                if (XmlSchemaTools.isEumeration(simpleType)) {
                    List<String> values = XmlSchemaTools.enumeratorValues(simpleType);
                    code.append("//\n");
                    code.append("// Simple type (enumeration) " + simpleType.getQName() + "\n");
                    code.append("//\n");
                    for (String value : values) {
                        code.append("// - " + value + "\n");
                    }
                }
            }
        }

        // now add in global elements with anonymous types.
        schemaTypes = schema.getSchema().getElements();
        namesIterator = schemaTypes.getNames();
        while (namesIterator.hasNext()) {
            QName name = (QName)namesIterator.next();
            XmlSchemaObject xmlSchemaObject = (XmlSchemaObject)schemaTypes.getItem(name);
            if (xmlSchemaObject instanceof XmlSchemaElement) { // the
                // alternative
                // is too wierd
                // to
                // contemplate.
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

        code.append("//\n");
        code.append("function " + typeObjectName + " () {\n");
        // to assist in debugging we put a type property into every object.
        utils.appendLine("this.typeMarker = '" + typeObjectName + "';");
        for (int i = 0; i < sequence.getItems().getCount(); i++) {
            XmlSchemaObject thing = sequence.getItems().getItem(i);
            constructOneElement(type, sequence, elementPrefix, typeObjectName, thing);
        }
        code.append("}\n\n");
        code.append(accessors.toString());
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

                                             JavascriptUtils bodyUtils) {

        XmlSchemaSequence sequence = XmlSchemaUtils.getSequence(type);

        for (int i = 0; i < sequence.getItems().getCount(); i++) {
            XmlSchemaObject sequenceItem = (XmlSchemaObject)sequence.getItems().getItem(i);
            ParticleInfo itemInfo = ParticleInfo.forLocalItem(sequenceItem,
                                                              schemaInfo.getSchema(),
                                                              xmlSchemaCollection,
                                                              prefixAccumulator,
                                                              type.getQName());
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaObject

        utils.appendLine("var item;");

        for (int i = 0; i < sequence.getItems().getCount(); i++) {
            utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
            XmlSchemaObject thing = sequence.getItems().getItem(i);
            ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing,
                                                              schemaInfo.getSchema(),
                                                              xmlSchemaCollection,
                                                              prefixAccumulator,
                                                              type.getQName());
            if (itemInfo.isAny()) {
                ParticleInfo nextItem = null;
                if (i != sequence.getItems().getCount() - 1) {
                    XmlSchemaObject nextThing = sequence.getItems().getItem(i + 1);
                    nextItem = ParticleInfo.forLocalItem(nextThing,
                                                         schemaInfo.getSchema(),
                                                         xmlSchemaCollection,
                                                         prefixAccumulator,
                                                         type.getQName());
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.