Package org.apache.axis.wsdl.wsdl2ws.info

Examples of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo


            ((QName)attributes.get(j + 1)).getLocalPart(),
          createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
        }
      }     
    }else if(type instanceof CollectionType){
      typedata.setTypeNameForElementName(new ElementInfo(type.getQName(),
          createTypeInfo(type.getRefType().getQName(),targetLanguage)));
      typedata.setArray(true);
    }else{
      //is this a SOAPEnc array type 
      QName arrayType =
        SchemaUtils.getArrayComponentQName(node, new IntHolder(0));
      if (arrayType != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      } else if (
        (arrayType = SchemaUtils.getCollectionComponentQName(node))
          != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      }
      //Note in a array the parameter type is stored as under the name item all the time 
      else {
        // get all extended types
        Vector extendList = new Vector();
        extendList.add(type);
        TypeEntry parent = SchemaUtils.getComplexElementExtensionBase(
                            type.getNode(),symbolTable);
        while(parent != null) {
          extendList.add(parent);
          parent = SchemaUtils.getComplexElementExtensionBase(
                        parent.getNode(),symbolTable);
        }
   
        // Now generate a list of names and types starting with
        // the oldest parent.  (Attrs are considered before elements).
        for (int i=extendList.size()-1; i >= 0; i--) {
          TypeEntry te = (TypeEntry) extendList.elementAt(i);
   
         
          //TODO the code require the attributes name at extension base types
          //different, the WSDL2Ws do not support it having same name at up and below.
         
          // The names of the inherited parms are mangled
          // in case they interfere with local parms.
          String mangle = "";
          //if (i > 0) {
          //  mangle = "_" +
          //    Utils.xmlNameToJava(te.getQName().getLocalPart()) +
          //    "_";
          //}
         
          // Process the attributes
          Vector attributes = SchemaUtils.getContainedAttributeTypes(
            te.getNode(), symbolTable);
          if (attributes != null) {
            for (int j=0; j<attributes.size(); j+=2) {
              typedata.setTypeForAttributeName(
                ((QName)attributes.get(j + 1)).getLocalPart(),
              createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
            }
          }
          // Process the elements
          Vector elements = SchemaUtils.getContainedElementDeclarations(
                      te.getNode(), symbolTable);
          if (elements != null) {
            for (int j=0; j<elements.size(); j++) {
              ElementInfo eleinfo = null;
              ElementDecl elem = (ElementDecl)elements.get(j);
              if (elem.getAnyElement()){
                System.out.println("Any Type found inside "+ type.getQName().toString());
                Type anyType = new Type(CUtils.anyTypeQname, CUtils.anyTypeQname.getLocalPart(), true, targetLanguage);
                eleinfo = new ElementInfo(elem.getName(),anyType);             
              }
              else{
                QName typeName = elem.getType().getQName();
                if(typeName.getLocalPart().indexOf('[')>0){
                  String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                  typeName = new QName(typeName.getNamespaceURI(),localpart);
                  if (CUtils.isBasicType(typeName)){
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
                  }
                  else{
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage));
                  }
                }
                else{
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));               
                }
              }
              eleinfo.setMinOccurs(elem.getMinOccrs());
              eleinfo.setMaxOccurs(elem.getMaxOccurs());
              typedata.setTypeNameForElementName(eleinfo);
            }     
          }
        }
      }
View Full Code Here


    }

    for (int i = intAttrFieldSz ; i < intAttrFieldSz+intEleFieldSz; i++) {
      this.attribs[i] = new AttributeInfo();
      this.attribs[i].setParamName((String) elementfeilds.get(i-attributeParamCount));  
      ElementInfo elem = type.getElementForElementName(this.attribs[i].getParamName());
      Type elementType = elem.getType();
      if(CUtils.isAnyType(elementType.getName())){
        this.attribs[i].setAnyType(true);
      }
      if(CUtils.isSimpleType(elementType.getName()))
        this.attribs[i].setTypeName(CUtils.getclass4qname(elementType.getName()));
      else{
        this.attribs[i].setTypeName(elementType.getLanguageSpecificName());
        this.attribs[i].setSimpleType(false);
      }
      this.attribs[i].setType(elementType);
      this.attribs[i].setElementName(elem.getName());
         if(elementType.isArray()){ //soap encoding arrays.
        Type arrayType = WrapperUtils.getArrayType(elementType); //get contained type
        this.attribs[i].setArray(true);
        if(CUtils.isSimpleType(arrayType.getName())){
          this.attribs[i].setTypeName(CUtils.getclass4qname(arrayType.getName()));
          this.attribs[i].setSimpleType(true);
        }
        else{
          this.attribs[i].setTypeName(arrayType.getLanguageSpecificName());
          this.attribs[i].setSimpleType(false);
        }
        this.attribs[i].setType(arrayType); //set contained type as type
       }else if (elem.getMaxOccurs() > 1){
           //arrays but the same type as was set above
        this.attribs[i].setArray(true);
       }
       if (elem.getMinOccurs() == 0) this.attribs[i].setOptional(true);
   
   }
View Full Code Here

     * @param type
     */
    private void addOutputElementsToMethodInfo(MethodInfo minfo, Type type)
    {
        ParameterInfo pinfo;
        ElementInfo eleinfo;
        ArrayList elementlist = new ArrayList();
        Iterator names = type.getElementnames();
        while (names.hasNext())
        {
            elementlist.add(names.next());
        }
        Type innerType;
        for (int i = 0; i < elementlist.size(); i++)
        {
            String elementname = (String) elementlist.get(i);
            eleinfo = type.getElementForElementName(elementname);
            innerType = eleinfo.getType();
            pinfo = new ParameterInfo(innerType, elementname);
            if (eleinfo.getMaxOccurs() > 1)
            {
                pinfo.setArray(true);
            }
            pinfo.setElementName(
                type.getElementForElementName(elementname).getName());
View Full Code Here

     * @param type
     */
    private void addInputElementsToMethodInfo(MethodInfo minfo, Type type)
    {
        ParameterInfo pinfo;
        ElementInfo eleinfo;
        Iterator elementNames = type.getElementnames();
        ArrayList elementlist = new ArrayList();
        while (elementNames.hasNext())
        {
            elementlist.add(elementNames.next());
        }

        for (int i = 0; i < elementlist.size(); i++)
        {
            String elementname = (String) elementlist.get(i);
            eleinfo = type.getElementForElementName(elementname);
            Type innerType = eleinfo.getType();
            pinfo = new ParameterInfo(innerType, elementname);
            if (eleinfo.getMaxOccurs() > 1)
            {
                pinfo.setArray(true);
            }
            pinfo.setElementName(
                type.getElementForElementName(elementname).getName());
View Full Code Here

            if (base != null)
            {
                String localpart = type.getQName().getLocalPart() + "_value";
                QName typeName =
                    new QName(type.getQName().getNamespaceURI(), localpart);
                ElementInfo eleinfo =
                    new ElementInfo(
                        typeName,
                        createTypeInfo(base.getQName(), targetLanguage));
                typedata.setExtensionBaseType(eleinfo);
                if (WSDL2Ws.verbose)
                    System.out.print(
                        "=====complexType with simpleContent is found : "
                            + type.getQName().getLocalPart()
                            + "=====\n");
            }
            else
            {
                //types declared as simpleType
                restrictdata =
                    CUtils.getRestrictionBaseAndValues(node, symbolTable);
                if (restrictdata != null)
                    typedata.setRestrictiondata(restrictdata);
            }
            // There can be attributes in this extended basic type
            // Process the attributes
            Vector attributes =
                CSchemaUtils.getContainedAttributeTypes(
                    type.getNode(),
                    symbolTable);
            if (attributes != null)
            {
                for (int j = 0; j < attributes.size(); j += 2)
                {
                    typedata.setTypeForAttributeName(
                        ((QName) attributes.get(j + 1)).getLocalPart(),
                        createTypeInfo(
                            ((TypeEntry) attributes.get(j)).getQName(),
                            targetLanguage));
                }
            }
        }
        else
            if (type instanceof CollectionType)
            {
                typedata.setTypeNameForElementName(
                    new ElementInfo(
                        type.getQName(),
                        createTypeInfo(
                            type.getRefType().getQName(),
                            targetLanguage)));
                typedata.setArray(true);
            }
            else
            {
                //is this a SOAPEnc array type 
                QName arrayType =
                    CSchemaUtils.getArrayComponentQName(
                        node,
                        new IntHolder(0),
                        symbolTable);
                if (arrayType != null)
                {
                    typedata.setTypeNameForElementName(
                        new ElementInfo(
                            new QName("item"),
                            createTypeInfo(arrayType, targetLanguage)));
                    typedata.setArray(true);
                }
                else
                    if ((arrayType =
                        CSchemaUtils.getCollectionComponentQName(node))
                        != null)
                    {
                        typedata.setTypeNameForElementName(
                            new ElementInfo(
                                new QName("item"),
                                createTypeInfo(arrayType, targetLanguage)));
                        typedata.setArray(true);
                    }
                //Note in a array the parameter type is stored as under the name item all the time 
                else
                {
                    // get all extended types
                    Vector extendList = new Vector();
                    extendList.add(type);
                    TypeEntry parent =
                        CSchemaUtils.getComplexElementExtensionBase(
                            type.getNode(),
                            symbolTable);
                    while (parent != null)
                    {
                        extendList.add(parent);
                        parent =
                            CSchemaUtils.getComplexElementExtensionBase(
                                parent.getNode(),
                                symbolTable);
                    }

                    // Now generate a list of names and types starting with
                    // the oldest parent.  (Attrs are considered before elements).
                    for (int i = extendList.size() - 1; i >= 0; i--)
                    {
                        TypeEntry te = (TypeEntry) extendList.elementAt(i);

                        //TODO the code require the attributes name at extension base types
                        //different, the WSDL2Ws do not support it having same name at up and below.

                        // The names of the inherited parms are mangled
                        // in case they interfere with local parms.
                        // String mangle = "";
                        //if (i > 0) {
                        //  mangle = "_" +
                        //    Utils.xmlNameToJava(te.getQName().getLocalPart()) +
                        //    "_";
                        //}

                        // Process the attributes
                        Vector attributes =
                            CSchemaUtils.getContainedAttributeTypes(
                                te.getNode(),
                                symbolTable);
                        if (attributes != null)
                        {
                            for (int j = 0; j < attributes.size(); j += 2)
                            {
                                typedata.setTypeForAttributeName(
                                    ((QName) attributes.get(j + 1))
                                        .getLocalPart(),
                                    createTypeInfo(
                                        ((TypeEntry) attributes.get(j))
                                            .getQName(),
                                        targetLanguage));
                            }
                        }
                        // Process the elements
                        Vector elements =
                            CSchemaUtils.getContainedElementDeclarations(
                                te.getNode(),
                                symbolTable);
                        if (elements != null)
                        {
                            for (int j = 0; j < elements.size(); j++)
                            {
                                ElementInfo eleinfo = null;
                                CElementDecl elem =
                                    (CElementDecl) elements.get(j);
                                if (elem.getAnyElement())
                                {

                                    Type anyType =
                                        new Type(
                                            CUtils.anyTypeQname,
                                            CUtils.anyTypeQname.getLocalPart(),
                                            true,
                                            targetLanguage);
                                    eleinfo =
                                        new ElementInfo(
                                            elem.getName(),
                                            anyType);
                                }
                                else
                                {
                                    QName typeName = elem.getType().getQName();
                                    if (typeName.getLocalPart().indexOf('[')
                                        > 0)
                                    {
                                        String localpart =
                                            typeName.getLocalPart().substring(
                                                0,
                                                typeName
                                                    .getLocalPart()
                                                    .indexOf(
                                                    '['));
                                        typeName =
                                            new QName(
                                                typeName.getNamespaceURI(),
                                                localpart);
                                        if (CUtils.isBasicType(typeName))
                                        {
                                            eleinfo =
                                                new ElementInfo(
                                                    elem.getName(),
                                                    createTypeInfo(
                                                        typeName,
                                                        targetLanguage));
                                        }
                                        else
                                        {
                                            eleinfo =
                                                new ElementInfo(
                                                    elem.getName(),
                                                    createTypeInfo(
                                                        elem.getType(),
                                                        targetLanguage));
                                        }
                                    }
                                    else
                                    {
                                        eleinfo =
                                            new ElementInfo(
                                                elem.getName(),
                                                createTypeInfo(
                                                    typeName,
                                                    targetLanguage));
                                    }
                                }
                                eleinfo.setMinOccurs(elem.getMinOccurs());
                                eleinfo.setMaxOccurs(elem.getMaxOccurs());
                                eleinfo.setNillable( elem.isNillable());
                                typedata.setTypeNameForElementName(eleinfo);
                            }
                        }
                    }
                }
View Full Code Here

    }

    /* genarate the attribs array */
    private void populateAttribList() throws WrapperFault
    {
        ElementInfo elemi = type.getExtensionBaseType();
        if (elemi != null)
        {
            extensionBaseAttrib = new AttributeInfo(this.classname);
            extensionBaseAttrib.setParamName(elemi.getName().getLocalPart());
            extensionBaseAttrib.setTypeName(
                CUtils.getclass4qname(elemi.getType().getName()));
            extensionBaseAttrib.setType(elemi.getType());
            extensionBaseAttrib.setElementName(elemi.getName());
        }
        ArrayList attribfeilds = new ArrayList();
        ArrayList elementfeilds = new ArrayList();

        Iterator names = type.getAttributeNames();
        while (names.hasNext())
        {
            attribfeilds.add(names.next());
        }
        names = type.getElementnames();
        while (names.hasNext())
        {
            elementfeilds.add(names.next());
        }
        int intAttrFieldSz = attribfeilds.size();
        attributeParamCount = intAttrFieldSz;
        int intEleFieldSz = elementfeilds.size();
        this.attribs = new AttributeInfo[intAttrFieldSz + intEleFieldSz];
        for (int i = 0; i < intAttrFieldSz; i++)
        {
            this.attribs[i] = new AttributeInfo(this.classname);
            this.attribs[i].setParamName((String) attribfeilds.get(i));
            Type attribType =
                type.getTypForAttribName(this.attribs[i].getParamName());
            if (CUtils.isSimpleType(attribType.getName()))
                this.attribs[i].setTypeName(
                    CUtils.getclass4qname(attribType.getName()));
            else
            {
                this.attribs[i].setTypeName(
                    attribType.getLanguageSpecificName());
                this.attribs[i].setSimpleType(false);
            }
            this.attribs[i].setType(attribType);
            this.attribs[i].setAttribute(true);
            this.attribs[i].setElementName(attribType.getName());
            //TODO this is wrong. correct immediately. this will cause attributes serialized incorrectly
            //TODO : how to find whether this attribute is optional or not ?
        }

        for (int i = intAttrFieldSz; i < intAttrFieldSz + intEleFieldSz; i++)
        {
            this.attribs[i] = new AttributeInfo(this.classname);
            this.attribs[i].setParamName(
                (String) elementfeilds.get(i - attributeParamCount));
            ElementInfo elem =
                type.getElementForElementName(this.attribs[i].getParamName());
            Type elementType = elem.getType();
            if (CUtils.isAnyType(elementType.getName()))
            {
                this.attribs[i].setAnyType(true);
            }
            if (CUtils.isSimpleType(elementType.getName()))
                this.attribs[i].setTypeName(
                    CUtils.getclass4qname(elementType.getName()));
            else
            {
                this.attribs[i].setTypeName(
                    elementType.getLanguageSpecificName());
                this.attribs[i].setSimpleType(false);
            }
            this.attribs[i].setType(elementType);
            this.attribs[i].setElementName(elem.getName());
            if (elementType.isArray())
            { //soap encoding arrays.
                Type arrayType = WrapperUtils.getArrayType(elementType);
                //get contained type
                this.attribs[i].setArray(true);
                if (CUtils.isSimpleType(arrayType.getName()))
                {
                    this.attribs[i].setTypeName(
                        CUtils.getclass4qname(arrayType.getName()));
                    this.attribs[i].setSimpleType(true);
                }
                else
                {
                    this.attribs[i].setTypeName(
                        arrayType.getLanguageSpecificName());
                    this.attribs[i].setSimpleType(false);
                }
                this.attribs[i].setType(arrayType);
                //set contained type as type
            }
            else
                if (elem.getMaxOccurs() > 1)
                {
                    //arrays but the same type as was set above
                    this.attribs[i].setArray(true);
                }
            if (elem.getMinOccurs() == 0)
                this.attribs[i].setOptional(true);
        }
    }
View Full Code Here

    if(type.isSimpleType()){
      restrictdata = CUtils.getRestrictionBaseAndValues(node,symbolTable);
      if(restrictdata != null)
        typedata.setRestrictiondata(restrictdata);
    }else if(type instanceof CollectionType){
      typedata.setTypeNameForElementName(new ElementInfo(type.getQName(),
          createTypeInfo(type.getRefType().getQName(),targetLanguage)));
      typedata.setArray(true);
    }else{
      //is this a SOAPEnc array type 
      QName arrayType =
        SchemaUtils.getArrayComponentQName(node, new IntHolder(0));
      if (arrayType != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      } else if (
        (arrayType = SchemaUtils.getCollectionComponentQName(node))
          != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      }
      //Note in a array the parameter type is stored as under the name item all the time 
      else {
        // get all extended types
        Vector extendList = new Vector();
        extendList.add(type);
        TypeEntry parent = SchemaUtils.getComplexElementExtensionBase(
                            type.getNode(),symbolTable);
        while(parent != null) {
          extendList.add(parent);
          parent = SchemaUtils.getComplexElementExtensionBase(
                        parent.getNode(),symbolTable);
        }
   
        // Now generate a list of names and types starting with
        // the oldest parent.  (Attrs are considered before elements).
        for (int i=extendList.size()-1; i >= 0; i--) {
          TypeEntry te = (TypeEntry) extendList.elementAt(i);
   
         
          //TODO the code require the attributes name at extension base types
          //different, the WSDL2Ws do not support it having same name at up and below.
         
          // The names of the inherited parms are mangled
          // in case they interfere with local parms.
          String mangle = "";
          //if (i > 0) {
          //  mangle = "_" +
          //    Utils.xmlNameToJava(te.getQName().getLocalPart()) +
          //    "_";
          //}
         
          // Process the attributes
          Vector attributes = SchemaUtils.getContainedAttributeTypes(
            te.getNode(), symbolTable);
          if (attributes != null) {
            for (int j=0; j<attributes.size(); j+=2) {
              typedata.setTypeForAttributeName(
                ((QName)attributes.get(j + 1)).getLocalPart(),
              createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
            }
          }
          // Process the elements
          Vector elements = SchemaUtils.getContainedElementDeclarations(
                      te.getNode(), symbolTable);
          if (elements != null) {
            for (int j=0; j<elements.size(); j++) {
              ElementInfo eleinfo = null;
              ElementDecl elem = (ElementDecl)elements.get(j);
              if (elem.getAnyElement()){
                System.out.println("Any Type found inside "+ type.getQName().toString());
                Type anyType = new Type(CUtils.anyTypeQname, CUtils.anyTypeQname.getLocalPart(), true, targetLanguage);
                eleinfo = new ElementInfo(elem.getName(),anyType);             
              }
              else{
                QName typeName = elem.getType().getQName();
                if(typeName.getLocalPart().indexOf('[')>0){
                  String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                  typeName = new QName(typeName.getNamespaceURI(),localpart);
                  if (CUtils.isBasicType(typeName)){
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
                  }
                  else{
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage));
                  }
                }
                else{
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));               
                }
              }
              eleinfo.setMinOccurs(elem.getMinOccrs());
              eleinfo.setMaxOccurs(elem.getMaxOccurs());
              typedata.setTypeNameForElementName(eleinfo);
            }     
          }
        }
      }
View Full Code Here

    }

    for (int i = intAttrFieldSz ; i < intAttrFieldSz+intEleFieldSz; i++) {
      this.attribs[i] = new AttributeInfo();
      this.attribs[i].setParamName((String) elementfeilds.get(i-attributeParamCount));  
      ElementInfo elem = type.getElementForElementName(this.attribs[i].getParamName());
      Type elementType = elem.getType();
      if(CUtils.isSimpleType(elementType.getName()))
        this.attribs[i].setTypeName(CUtils.getclass4qname(elementType.getName()));
      else{
        this.attribs[i].setTypeName(elementType.getLanguageSpecificName());
        this.attribs[i].setSimpleType(false);
      }
      this.attribs[i].setType(elementType);
      this.attribs[i].setElementName(elem.getName());
         if(elementType.isArray()){ //soap encoding arrays.
        Type arrayType = WrapperUtils.getArrayType(elementType); //get contained type
        this.attribs[i].setArray(true);
        if(CUtils.isSimpleType(arrayType.getName())){
          this.attribs[i].setTypeName(CUtils.getclass4qname(arrayType.getName()));
          this.attribs[i].setSimpleType(true);
        }
        else{
          this.attribs[i].setTypeName(arrayType.getLanguageSpecificName());
          this.attribs[i].setSimpleType(false);
        }
        this.attribs[i].setType(arrayType); //set contained type as type
       }else if (elem.getMaxOccurs() > 1){
           //arrays but the same type as was set above
        this.attribs[i].setArray(true);
       }
       if (elem.getMinOccurs() == 0) this.attribs[i].setOptional(true);
   
   }
View Full Code Here

    if(type.isSimpleType()){
      restrictdata = CUtils.getRestrictionBaseAndValues(node,symbolTable);
      if(restrictdata != null)
        typedata.setRestrictiondata(restrictdata);
    }else if(type instanceof CollectionType){
      typedata.setTypeNameForElementName(new ElementInfo(type.getQName(),
          createTypeInfo(type.getRefType().getQName(),targetLanguage)));
      typedata.setArray(true);
    }else{
      //is this a SOAPEnc array type 
      QName arrayType =
        SchemaUtils.getArrayComponentQName(node, new IntHolder(0));
      if (arrayType != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      } else if (
        (arrayType = SchemaUtils.getCollectionComponentQName(node))
          != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      }
      //Note in a array the parameter type is stored as under the name item all the time 
      else {
        // get all extended types
        Vector extendList = new Vector();
        extendList.add(type);
        TypeEntry parent = SchemaUtils.getComplexElementExtensionBase(
                            type.getNode(),symbolTable);
        while(parent != null) {
          extendList.add(parent);
          parent = SchemaUtils.getComplexElementExtensionBase(
                        parent.getNode(),symbolTable);
        }
   
        // Now generate a list of names and types starting with
        // the oldest parent.  (Attrs are considered before elements).
        for (int i=extendList.size()-1; i >= 0; i--) {
          TypeEntry te = (TypeEntry) extendList.elementAt(i);
   
         
          //TODO the code require the attributes name at extension base types
          //different, the WSDL2Ws do not support it having same name at up and below.
         
          // The names of the inherited parms are mangled
          // in case they interfere with local parms.
          String mangle = "";
          //if (i > 0) {
          //  mangle = "_" +
          //    Utils.xmlNameToJava(te.getQName().getLocalPart()) +
          //    "_";
          //}
         
          // Process the attributes
          Vector attributes = SchemaUtils.getContainedAttributeTypes(
            te.getNode(), symbolTable);
          if (attributes != null) {
            for (int j=0; j<attributes.size(); j+=2) {
              typedata.setTypeForAttributeName(
                ((QName)attributes.get(j + 1)).getLocalPart(),
              createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
            }
          }
          // Process the elements
          Vector elements = SchemaUtils.getContainedElementDeclarations(
                      te.getNode(), symbolTable);
          if (elements != null) {
            for (int j=0; j<elements.size(); j++) {
              ElementDecl elem = (ElementDecl)elements.get(j);
              QName typeName = elem.getType().getQName();
              ElementInfo eleinfo = null;
              if(typeName.getLocalPart().indexOf('[')>0){
                String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                typeName = new QName(typeName.getNamespaceURI(),localpart);
                if (CUtils.isBasicType(typeName)){
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
                }
                else{
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage));
                }
              }
              else{
                eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));               
              }
              eleinfo.setMinOccurs(elem.getMinOccrs());
              eleinfo.setMaxOccurs(elem.getMaxOccurs());
              typedata.setTypeNameForElementName(eleinfo);
            }     
          }
        }
      }
View Full Code Here

     * @param type
     */
    private void addOutputElementsToMethodInfo(MethodInfo minfo, Type type)
    {
        ParameterInfo pinfo;
        ElementInfo eleinfo;
        ArrayList elementlist = new ArrayList();
        Iterator names = type.getElementnames();
        while (names.hasNext())
        {
            elementlist.add(names.next());
        }
        Type innerType;
        for (int i = 0; i < elementlist.size(); i++)
        {
            String elementname = (String) elementlist.get(i);
            eleinfo = type.getElementForElementName(elementname);
            innerType = eleinfo.getType();
            pinfo = new ParameterInfo(innerType, elementname);
            if (eleinfo.getMaxOccurs() > 1)
            {
                pinfo.setArray(true);
            }
            pinfo.setNillable(eleinfo.getNillable());
            pinfo.setElementName(
                type.getElementForElementName(elementname).getName());
            if (innerType.getName().equals(CUtils.anyTypeQname))
            {
                pinfo.setAnyType(true);
View Full Code Here

TOP

Related Classes of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo

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.