Package org.apache.ws.commons.schema

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


    return (((XmlSchemaComplexType) ((XmlSchemaElement) ((XmlSchemaSequence) wrapperSchemaComplexType
        .getParticle()).getItems().getItem(0)).getSchemaType()));
  }
 
  private static XmlSchemaObjectCollection getSchemaObjectsFromComplexType(XmlSchemaComplexType schemaComplexType) {
    XmlSchemaObjectCollection collection = new XmlSchemaObjectCollection();
    XmlSchemaSequence sequence = (XmlSchemaSequence) schemaComplexType.getParticle();
    if (sequence != null) {
      XmlSchemaObjectCollection seqItems = sequence.getItems();
      int c = seqItems.getCount();
      for (int i = 0; i < c; i++) {
        // add elements
        collection.add(seqItems.getItem(i));
      }
    }
    XmlSchemaObjectCollection attrItems = schemaComplexType.getAttributes();
    int c = attrItems.getCount();
    for (int i = 0; i < c; i++) {
      // add attributes
      collection.add(attrItems.getItem(i));
    }
    return collection;
  }
View Full Code Here


            }
            if (!(particle instanceof XmlSchemaSequence)) {
                return null;
            }
            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

            }
            if (!(particle instanceof XmlSchemaSequence)) {
                return null;
            }
            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

    private static boolean isWrappableSequence(XmlSchemaComplexType type, String namespaceURI,
                                               MessageInfo wrapper, boolean allowRefs) {
        if (type.getParticle() instanceof XmlSchemaSequence) {
            XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
            XmlSchemaObjectCollection items = seq.getItems();
            boolean ret = true;
            for (int x = 0; x < items.getCount(); x++) {
                XmlSchemaObject o = items.getItem(x);
                if (!(o instanceof XmlSchemaElement)) {
                    return false;
                }
                XmlSchemaElement el = (XmlSchemaElement)o;
View Full Code Here

        XmlSchemaElement xmlSchemaElement = null;
        if (schema != null) {
            xmlSchemaElement = schema.getElementByName(elementQName);
            if (xmlSchemaElement == null) {
                // try to find in an import or an include
                XmlSchemaObjectCollection includes = schema.getIncludes();
                if (includes != null) {
                    Iterator includesIter = includes.getIterator();
                    Object object;
                    while (includesIter.hasNext()) {
                        object = includesIter.next();
                        if (object instanceof XmlSchemaImport) {
                            org.apache.ws.commons.schema.XmlSchema schema1 =
View Full Code Here

      }
    }
  }

  private void updateSchemaLocation(XmlSchema schema) {
      XmlSchemaObjectCollection includes = schema.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();
              updateSchemaLocation(s, xmlSchemaExternal);
          }
View Full Code Here

  private void calculateSchemaNames(List schemas, Hashtable nameTable,
      Hashtable sourceURIToNewLocationMap, boolean overrideAbsoluteAddress) {
    // 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();
View Full Code Here

   * @param parentSchema
   * @param nameTable
   */
  private void adjustSchemaName(XmlSchema parentSchema, Hashtable nameTable,
      Hashtable importedScheams, Hashtable sourceURIToNewLocationMap) {
    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, sourceURIToNewLocationMap);
View Full Code Here

        XmlSchemaElement xmlSchemaElement = null;
        if (schema != null) {
            xmlSchemaElement = schema.getElementByName(this.elementQname);
            if (xmlSchemaElement == null) {
                // try to find in an import or an include
                XmlSchemaObjectCollection includes = schema.getIncludes();
                if (includes != null) {
                    Iterator includesIter = includes.getIterator();
                    Object object;
                    while (includesIter.hasNext()) {
                        object = includesIter.next();
                        if (object instanceof XmlSchemaImport) {
                            XmlSchema schema1 = ((XmlSchemaImport) object).getSchema();
View Full Code Here

                if (type != null && type instanceof XmlSchemaComplexType){
                    XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
                    XmlSchemaParticle particle = complexType.getParticle();
                    if (particle != null && particle instanceof XmlSchemaSequence){
                        XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
                        XmlSchemaObjectCollection schemaObjectCollection =
                                xmlSchemaSequence.getItems();
                        if (schemaObjectCollection != null) {
                            Iterator iterator = schemaObjectCollection.getIterator();
                            while (iterator.hasNext()) {
                                Object next = iterator.next();
                                if (!(next instanceof XmlSchemaElement)) {
                                    return new URI [0];
                                }
                                XmlSchemaElement innerElement = (XmlSchemaElement) next;
                                if (innerElement.getRefName() != null) {
                                    return new URI [0];
                                }
                                if (innerElement.getMinOccurs() != 1 ||
                                        innerElement.getMaxOccurs() != 1) {
                                    isMultipart = false;
                                }
                                XmlSchemaType schemaType = innerElement.getSchemaType();
                                QName innerElementQName = innerElement.getSchemaTypeName();
                                if (schemaType instanceof XmlSchemaSimpleType) {
                                    if (Constants.XSD_QNAME.equals(innerElementQName) ||
                                            Constants.XSD_NOTATION.equals(innerElementQName) ||
                                            Constants.XSD_HEXBIN.equals(innerElementQName) ||
                                            Constants.XSD_BASE64.equals(innerElementQName)) {
                                            isIRI = false;
                                    }
                                } else {
                                    isIRI = false;
                                }
                                if (Constants.XSD_ANY.equals(innerElementQName) && iterator.hasNext()) {
                                    isRPC = false;
                                }
                                String name = innerElement.getName();
                                if (inMessageElementDetails.get(name) != null) {
                                    isRPC = false;
                                    isMultipart = false;
                                }
                                inMessageElementDetails.put(name, innerElementQName);
                            }
                        }
                    } else {
                        return new URI [0];
                    }
                } else {
                        return new URI [0];
                    }
            } else {
                return new URI [0];
            }
        } else {
            return new URI [0];
        }
        AxisMessage outMessage = null;
        Map outMessageElementDetails = new LinkedHashMap();
        if (isRPC && !WSDL2Constants.MEP_URI_IN_ONLY.equals(mep)) {
            outMessage = axisOperation.getMessage(WSDL2Constants.MESSAGE_LABEL_OUT);
            QName qName = outMessage.getElementQName();
            if (qName == null && Constants.XSD_ANY.equals(qName)) {
                isRPC = false;
            }
            XmlSchemaElement schemaElement = outMessage.getSchemaElement();
            if (schemaElement != null) {
                if (!(axisOperation.getName().getLocalPart() + Java2WSDLConstants.RESPONSE)
                        .equals(schemaElement.getName())) {
                    isRPC = false;
                }
                if (!schemaElement.getQName().getNamespaceURI()
                        .equals(inMessageElementQname.getNamespaceURI())) {
                    isRPC = false;
                }
                XmlSchemaType type = schemaElement.getSchemaType();
                if (type != null && type instanceof XmlSchemaComplexType) {
                    XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
                    XmlSchemaParticle particle = complexType.getParticle();
                    if (particle != null && particle instanceof XmlSchemaSequence) {
                        XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
                        XmlSchemaObjectCollection schemaObjectCollection =
                                xmlSchemaSequence.getItems();
                        if (schemaObjectCollection != null) {
                            Iterator iterator = schemaObjectCollection.getIterator();
                            while (iterator.hasNext()) {
                                Object next = iterator.next();
                                if (!(next instanceof XmlSchemaElement)) {
                                    isRPC = false;
                                }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaObjectCollection

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.