Package org.apache.axis.wsdl.symbolTable

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


    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


      }

      // 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

 
  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

      }

      // 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 == null || javaName.equals("boolean") ||
            ! SchemaUtils.isSimpleSchemaType(baseEType.getQName())) {
            baseEType = null;
          }
        }
      }
View Full Code Here

     * @return the type map with type info
     */
    private TypeMap getTypeInfo(String targetLanguage) throws WrapperFault
    {
        Iterator it = symbolTable.getTypeIndex().values().iterator();
        TypeEntry type;

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

            }
View Full Code Here

    }

    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

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

        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()))
View Full Code Here

        // Add all the types nested and derived from the types
        // in the first pass.
        Iterator i = firstPassTypes.iterator();
        while (i.hasNext()) {
            TypeEntry type = (TypeEntry) i.next();
            if (!types.contains(type)) {
                types.add(type);
                types.addAll(
                   Utils.getNestedTypes(type, symbolTable, true));
            }
View Full Code Here

        // loop over paramters and set up in/out params
        for (int i = 0; i < parms.list.size(); ++i) {
            Parameter p = (Parameter) parms.list.get(i);

            // We need to use the Qname of the actual type, not the QName of the element
            TypeEntry type = p.getType();
            if (type instanceof DefinedElement
                    && type.getRefType() != null) {
                type = type.getRefType();
            }
            QName qn = type.getQName();
            String javaType = type.getName();

            if (javaType != null) {
                javaType += ".class, ";
            } else {
                javaType = "";
            }

            String typeString = "new javax.xml.namespace.QName(\"" +
                    qn.getNamespaceURI() + "\", \"" +
                    qn.getLocalPart() + "\")";
            QName paramQName = p.getQName();
            String qnName = "p" + i + "QName";
            pw.println("        javax.xml.namespace.QName " + qnName + " = new javax.xml.namespace.QName(\"" +
                    paramQName.getNamespaceURI() + "\", \"" +
                    paramQName.getLocalPart() + "\");");
            if (p.getMode() == Parameter.IN) {
                pw.println("        call.addParameter(" + qnName + ", "
                           + typeString + ", "
                           + javaType + "javax.xml.rpc.ParameterMode.IN);");
            }
            else if (p.getMode() == Parameter.INOUT) {
                pw.println("        call.addParameter(" + qnName + ", "
                           + typeString + ", "
                           + javaType + "javax.xml.rpc.ParameterMode.INOUT);");
            }
            else { // p.getMode() == Parameter.OUT
                pw.println("        call.addParameter(" + qnName + ", "
                           + typeString + ", "
                           + javaType + "javax.xml.rpc.ParameterMode.OUT);");
            }
        }
        // set output type
        if (parms.returnType != null) {
            // We need to use the Qname of the actual type, not the QName of the element
            QName qn = parms.returnType.getQName();
            if (parms.returnType instanceof DefinedElement) {
                TypeEntry type = ((DefinedElement) parms.returnType).getRefType();
                if (type != null && type.getQName() != null) {
                    qn = type.getQName();
                }
            }
            String outputType = "new javax.xml.namespace.QName(\"" +
                qn.getNamespaceURI() + "\", \"" +
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.