Package org.apache.axis.wsdl.symbolTable

Examples of org.apache.axis.wsdl.symbolTable.TypeEntry


      }

      // The restriction node indicates the type being restricted
      // (the base attribute contains this type).
      // The base type must be a simple type, and not boolean
      TypeEntry baseEType = null;
      if (restrictionNode != null) {
        QName baseType = Utils.getTypeQName(restrictionNode, new BooleanHolder(), false);
        baseEType = symbolTable.getType(baseType);
        if (baseEType != null) {
          String javaName = TypeMap.getBasicTypeClass4qname(baseEType.getQName());
          //String javaName = baseEType.getName();
          if (javaName.equals("boolean") ||
            ! SchemaUtils.isSimpleSchemaType(baseEType.getQName())) {
            baseEType = null;
          }
        }
      }
View Full Code Here


     }
     throw new WrapperFault("the service does not exists");
    }
   
  public Type createTypeInfo(QName typename,String targetLanguage)throws WrapperFault{
    TypeEntry type = symbolTable.getType(typename)
    if(type == null){
      type = symbolTable.getElement(typename);
      if(type == null){
        throw new WrapperFault("["+typename+"]unexpected condition occured " +
          ".. please inform the axis-dev@apache.org mailing list ASAP");
      }
      type.getRefType();
    }
    return createTypeInfo(type,targetLanguage);
  }
View Full Code Here

    Node node = type.getNode();

    Vector restrictdata = null;
    if(type.isSimpleType()){
      //check for extended types
      TypeEntry base = SchemaUtils.getComplexElementExtensionBase(type.getNode(),symbolTable);
      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 = SchemaUtils.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 =
        SchemaUtils.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 = 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()){
View Full Code Here

    QName qname = part.getTypeName();
    if(qname == null){
      Element element = symbolTable.getElement(part.getElementName());
      qname = element.getRefType().getQName();
    }
    TypeEntry tentry = symbolTable.getType(qname);   
    Type type = this.typeMap.getType(qname);
    if(type == null)
      throw new WrapperFault("unregisterd type "+qname+" refered");
    ParameterInfo parainfo =
      new ParameterInfo(type,part.getName());
View Full Code Here

     * This method extract the custom complex type info fom the symbol table
     * @return the type map with type info
     */
    private TypeMap getTypeInfo(String targetLanguage)throws WrapperFault {
        Iterator it = symbolTable.getTypeIndex().values().iterator();
        TypeEntry type;
        Iterator elements;
        Type typedata;

        boolean hasElements;
        while (it.hasNext()) {
            type = (TypeEntry) it.next();
            Node node = type.getNode();
            if (node != null) {
          createTypeInfo(type,targetLanguage);

            }
        } //end of type while
View Full Code Here

 
  protected void writeSimpleTypeWithEnumerations() throws WrapperFault{
    try{
      Vector restrictionData = type.getEnumerationdata();
      if ( restrictionData == null) return;
      TypeEntry baseEType = (TypeEntry)restrictionData.firstElement();
      QName baseType = baseEType.getQName();
      if (!CUtils.isSimpleType(baseType)) return;
      String langTypeName = CUtils.getclass4qname(baseType);
      writer.write("typedef ");
      if ("string".equals(baseType.getLocalPart()) || "NMTOKEN".equals(baseType.getLocalPart())){
        writer.write(langTypeName + " " + classname + ";\n");
View Full Code Here

  protected void writeSimpleTypeWithEnumerations() throws WrapperFault{
    try{
      Vector restrictionData = type.getEnumerationdata();
      if ( restrictionData == null) return;
      TypeEntry baseEType = (TypeEntry)restrictionData.firstElement();
      QName baseType = baseEType.getQName();
      if (!CUtils.isSimpleType(baseType)) return;
      String langTypeName = CUtils.getclass4qname(baseType);
      writer.write("typedef ");
      if ("string".equals(baseType.getLocalPart())){
        writer.write(langTypeName + " " + classname + ";\n");
View Full Code Here

     * This method extract the custom complex type info fom the symbol table
     * @return the type map with type info
     */
    private TypeMap getTypeInfo(String targetLanguage)throws WrapperFault {
        Iterator it = symbolTable.getTypeIndex().values().iterator();
        TypeEntry type;
        Iterator elements;
        Type typedata;

        boolean hasElements;
        while (it.hasNext()) {
            type = (TypeEntry) it.next();
            Node node = type.getNode();
            if (node != null) {
          createTypeInfo(type,targetLanguage);

            }
        } //end of type while
View Full Code Here

     }
     throw new WrapperFault("the service does not exists");
    }
   
  public Type createTypeInfo(QName typename,String targetLanguage)throws WrapperFault{
    TypeEntry type = symbolTable.getType(typename)
    if(type == null){
      type = symbolTable.getElement(typename);
      if(type == null){
        throw new WrapperFault("["+typename+"]unexpected condition occured " +
          ".. please inform the axis-dev@apache.org mailing list ASAP");
      }
      type.getRefType();
    }
    return createTypeInfo(type,targetLanguage);
  }
View Full Code Here

    Node node = type.getNode();

    Vector restrictdata = null;
    if(type.isSimpleType()){
      //check for extended types
      TypeEntry base = SchemaUtils.getComplexElementExtensionBase(type.getNode(),symbolTable);
      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 = SchemaUtils.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 =
        SchemaUtils.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 = 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()){
View Full Code Here

TOP

Related Classes of org.apache.axis.wsdl.symbolTable.TypeEntry

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.