Examples of XmlSchemaObjectCollection


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

        XmlSchemaSimpleTypeContent content = type.getContent();
        if (!(content instanceof XmlSchemaSimpleTypeRestriction)) {
            return false;
        }
        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
        XmlSchemaObjectCollection facets = restriction.getFacets();
        for (int x = 0; x < facets.getCount(); x++) {
            XmlSchemaFacet facet = (XmlSchemaFacet) facets.getItem(x);
            if (!(facet instanceof XmlSchemaEnumerationFacet)) {
                return false;
            }
        }
        return true;
View Full Code Here

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

     * @return
     */
    public static List<String> enumeratorValues(XmlSchemaSimpleType type) {
        XmlSchemaSimpleTypeContent content = type.getContent();
        XmlSchemaSimpleTypeRestriction restriction = (XmlSchemaSimpleTypeRestriction) content;
        XmlSchemaObjectCollection facets = restriction.getFacets();
        List<String> values = new ArrayList<String>();
        for (int x = 0; x < facets.getCount(); x++) {
            XmlSchemaFacet facet = (XmlSchemaFacet) facets.getItem(x);
            XmlSchemaEnumerationFacet enumFacet = (XmlSchemaEnumerationFacet) facet;
            values.add(enumFacet.getValue().toString());
        }
        return values;
    }
View Full Code Here

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

     * @param schema
     * @param namespaceUri
     * @return
     */
    public static boolean schemaImportsNamespace(XmlSchema schema, String namespaceUri) {
        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 true;
View Full Code Here

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

            || XmlSchemaConstants.XSD_NAMESPACE_URI.equals(namespaceUri)
            || schema.getTargetNamespace().equals(namespaceUri)) {
            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;
                }
            }
        }
        XmlSchemaImport imp = new XmlSchemaImport();
        imp.setNamespace(namespaceUri);
        inc.add(imp);
        schema.getItems().add(imp);
    }
View Full Code Here

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

        if (baseTypeName != null) {
            XmlSchemaComplexType baseType = (XmlSchemaComplexType)collection.getTypeByQName(baseTypeName);
            // recurse onto the base type ...
            results.addAll(getContentAttributes(baseType, collection));
            // and now process our sequence.
            XmlSchemaObjectCollection extAttrs = getContentAttributes(type);
            for (int i = 0; i < extAttrs.getCount(); i++) {
                results.add((XmlSchemaAnnotated)extAttrs.getItem(i));
            }
            return results;
        } else {
            // no base type, the simple case.
            XmlSchemaObjectCollection attrs = type.getAttributes();
            for (int i = 0; i < attrs.getCount(); i++) {
                results.add((XmlSchemaAnnotated)attrs.getItem(i));
            }
            return results;
        }
    }
View Full Code Here

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

            }
        }
    }

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

        return false;
    }

    private static boolean buildMessageParts(XmlSchemaSequence seq, String namespaceURI, MessageInfo wrapper,
                                             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.XmlSchemaObjectCollection

     */
    private void calcualteSchemaNames(List schemas, Hashtable nameTable) {
        //first traversal - fill the hashtable
        for (int i = 0; i < schemas.size(); i++) {
            XmlSchema schema = (XmlSchema) schemas.get(i);
            XmlSchemaObjectCollection includes = schema.getIncludes();

            for (int j = 0; j < includes.getCount(); j++) {
                Object item = includes.getItem(j);
                XmlSchema s;
                if (item instanceof XmlSchemaExternal) {
                    XmlSchemaExternal externalSchema = (XmlSchemaExternal) item;
                    s = externalSchema.getSchema();
                    if (s != null && nameTable.get(s) == null) {
View Full Code Here

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

     *
     * @param parentSchema
     * @param nameTable
     */
    private void adjustSchemaName(XmlSchema parentSchema, Hashtable nameTable, Hashtable importedScheams) {
        XmlSchemaObjectCollection includes = parentSchema.getIncludes();
        for (int j = 0; j < includes.getCount(); j++) {
            Object item = includes.getItem(j);
            if (item instanceof XmlSchemaExternal) {
                XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
                XmlSchema s = xmlSchemaExternal.getSchema();
                adjustSchemaLocation(s, xmlSchemaExternal, nameTable, importedScheams);
            }
View Full Code Here

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

                }
                XmlSchemaSequence sequence = (XmlSchemaSequence)particle;
               
                // add child param element matching each child of wrapper element
                QName opName = ((AxisOperation)msg.getParent()).getName();
                XmlSchemaObjectCollection items = sequence.getItems();
                boolean first = true;
                for (Iterator iter = items.getIterator(); iter.hasNext();) {
                   
                    // check that child item obeys the unwrapping rules
                    XmlSchemaParticle item = (XmlSchemaParticle)iter.next();
                    if (!(item instanceof XmlSchemaElement)) {
                        throw new RuntimeException("Cannot unwrap element " +
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.