Examples of TypeEntry


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

                // we are going to catch fault Exceptions
                pw.println("        try {");
                indent = "    ";
            }
            if (params.returnParam != null) {
                TypeEntry returnType = params.returnParam.getType();
                pw.print("        " + indent);
                pw.print(Utils.getParameterTypeName(params.returnParam));
                pw.print(" value = ");

                if (params.returnParam.getMIMEType() == null &&
                        Utils.isPrimitiveType(returnType)) {
                    if ("boolean".equals(returnType.getName())) {
                        pw.println("false;");
                    } else {
                        pw.println("-3;");
                    }
                } else {
View Full Code Here

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

            }
        }

        // Print the return statement
        if (parms.returnParam != null) {
            TypeEntry returnType = parms.returnParam.getType();
            pw.print("        return ");

            if (Utils.isPrimitiveType(returnType)) {
                String returnString = returnType.getName();
                if ("boolean".equals(returnString)) {
                    pw.println("false;");
                } else if ("byte".equals(returnString)) {
                    pw.println("(byte)-3;");
                } else if ("short".equals(returnString)) {
View Full Code Here

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

                 if(entry.getName() != null)
                    continue;

                // Use the type or the referenced type's QName to generate the java name.
                if (entry instanceof TypeEntry) {
                    TypeEntry tEntry = (TypeEntry) entry;
                    String dims = tEntry.getDimensions();
                    TypeEntry refType = tEntry.getRefType();
                    while (refType != null) {
                        tEntry = refType;
                        dims += tEntry.getDimensions();
                        refType = tEntry.getRefType();
                    }
View Full Code Here

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

        } catch (IOException e) {}
       
        // Inspect each TypeEntry referenced in a Fault Message Part
        String exceptionClassName = null;
        for(int j=0; j < parts.size(); j++) {
            TypeEntry te = ((Parameter)(parts.elementAt(j))).getType();

            // If the TypeEntry is an element, advance to the type.
            // This occurs if the message part uses the element= attribute
            TypeEntry elementTE = null;
            if (te instanceof Element) {
                elementTE = te;
                te = te.getRefType();
            }

            // remember the QName of the type.
            faultXmlType = te.getQName();
           
            // Determine if the te should be processed using the
            // simple type mapping or the complex type mapping
            // NOTE: treat array types as simple types
            if (te.getBaseType() != null ||
                te.isSimpleType() ||
                  (te.getDimensions().length() > 0 &&
                    te.getRefType().getBaseType() != null) ) {
                // Simple Type Exception
            } else {
                // Complex Type Exception
                Boolean isComplexFault = (Boolean) te.getDynamicVar(
                    JavaGeneratorFactory.COMPLEX_TYPE_FAULT);
                if (isComplexFault == null ||
                    !isComplexFault.booleanValue()) {
                    // Mark the type as a complex type fault
                    te.setDynamicVar(
                        JavaGeneratorFactory.COMPLEX_TYPE_FAULT,
                        new Boolean(true));
                    if (elementTE != null) {
                        te.setDynamicVar(
                           JavaGeneratorFactory.COMPLEX_TYPE_FAULT,
                           new Boolean(true));
                    }

                    // Mark all derived types as Complex Faults
                    HashSet derivedSet =
                        org.apache.axis.wsdl.symbolTable.Utils.getDerivedTypes(
                            te, symbolTable);
                    Iterator derivedI = derivedSet.iterator();
                    while(derivedI.hasNext()) {
                        TypeEntry derivedTE = (TypeEntry)
                            derivedI.next();
                        derivedTE.setDynamicVar(
                            JavaGeneratorFactory.COMPLEX_TYPE_FAULT,
                            new Boolean(true));
                    }
                    // Mark all base types as Complex Faults
                    TypeEntry base = SchemaUtils.getComplexElementExtensionBase(
                        te.getNode(),
                        symbolTable);
                    while (base != null) {
                        base.setDynamicVar(
                            JavaGeneratorFactory.COMPLEX_TYPE_FAULT,
                            new Boolean(true));
                        base = SchemaUtils.getComplexElementExtensionBase(
                            base.getNode(),
                            symbolTable);
                    }
                }
                // The exception class name is the name of the type
                exceptionClassName = te.getName();
View Full Code Here

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

                            // an anonymous type, then need to change the
                            // java name of the anonymous type to match.
                            QName anonQName = new QName(entry.getQName().getNamespaceURI(),
                                                        SymbolTable.ANON_TOKEN +
                                                        entry.getQName().getLocalPart());
                            TypeEntry anonType = symbolTable.getType(anonQName);
                            if (anonType != null) {
                                anonType.setName(entry.getName());
                                anonTypes.add(anonType);
                            }
                        }
                        else if (entry instanceof TypeEntry) {
                            // Search all other types for java names that match this one.
                            // The sameJavaClass method returns true if the java names are
                            // the same (ignores [] ).
                            if (firstType) {
                                firstType = false;
                                Vector types = symbolTable.getTypes();
                                for (int j = 0; j < types.size(); ++j) {
                                    TypeEntry type = (TypeEntry)
                                            types.elementAt(j);
                                    if (type != entry &&
                                            !(type instanceof Element) &&
                                            type.getBaseType() == null &&
                                            sameJavaClass(
                                                    ((Type) entry).getName(),
                                                    type.getName())) {
                                        v.add(type)
                                    }
                                }
                            }
                            // If this is an anonymous type, it's name was resolved in
View Full Code Here

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

                                    (Parameter)parms.list.get(j);
                           
                            // If the given parameter is an inout or out parameter, then
                            // set a HOLDER_IS_NEEDED flag using the dynamicVar design.
                            if (p.getMode() != Parameter.IN) {
                                TypeEntry typeEntry = p.getType();
                                typeEntry.setDynamicVar(
                                        JavaTypeWriter.HOLDER_IS_NEEDED,
                                        new Boolean(true));
                                //If this is a complex then set the HOLDER_IS_NEEDED
                                //for the reftype too.
                                if(!typeEntry.isSimpleType() && typeEntry.getRefType()!=null){
                                    typeEntry.getRefType().setDynamicVar(
                                        JavaTypeWriter.HOLDER_IS_NEEDED,
                                        new Boolean(true));
                                }

                                // If the type is a DefinedElement, need to
                                // set HOLDER_IS_NEEDED on the anonymous type.
                                QName anonQName = SchemaUtils.
                                    getElementAnonQName(p.getType().getNode());
                                if (anonQName != null) {
                                    TypeEntry anonType =
                                        symbolTable.getType(anonQName);
                                    if (anonType != null) {
                                        anonType.setDynamicVar(
                                            JavaTypeWriter.HOLDER_IS_NEEDED,
                                            new Boolean(true));
                                    }                                   
                                }
                            }
View Full Code Here

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

                    "org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory",
                    Constants.URI_DEFAULT_SOAP_ENC);
        }

        for (int i = 0; i < types.size(); ++i) {
            TypeEntry type = (TypeEntry) types.elementAt(i);

            // Note this same check is repeated in JavaStubWriter.
            boolean process = true;

            // 1) Don't register types that are base (primitive) types.
            //    If the baseType != null && getRefType() != null this
            //    is a simpleType that must be registered.
            // 2) Don't register the special types for collections
            //    (indexed properties) or element types
            // 3) Don't register types that are not referenced
            //    or only referenced in a literal context.
            if ((type.getBaseType() != null && type.getRefType() == null) ||
                type instanceof CollectionTE ||
                type instanceof Element ||
                !type.isReferenced() ||
                type.isOnlyLiteralReferenced()) {
                process = false;
            }

            if (process) {
                String namespaceURI = type.getQName().getNamespaceURI();
                String localPart = type.getQName().getLocalPart();
                String javaType = type.getName();
                String serializerFactory;
                String deserializerFactory;
                String encodingStyle = "";
                if (!hasLiteral) {
                    encodingStyle = Constants.URI_DEFAULT_SOAP_ENC;
                }

                if (javaType.endsWith("[]")) {
                    serializerFactory = "org.apache.axis.encoding.ser.ArraySerializerFactory";
                    deserializerFactory = "org.apache.axis.encoding.ser.ArrayDeserializerFactory";
                } else if (type.getNode() != null &&
                   Utils.getEnumerationBaseAndValues(
                     type.getNode(), symbolTable) != null) {
                    serializerFactory = "org.apache.axis.encoding.ser.EnumSerializerFactory";
                    deserializerFactory = "org.apache.axis.encoding.ser.EnumDeserializerFactory";
                } else if (type.isSimpleType()) {
                    serializerFactory = "org.apache.axis.encoding.ser.SimpleSerializerFactory";
                    deserializerFactory = "org.apache.axis.encoding.ser.SimpleDeserializerFactory";
                } else if (type.getBaseType() != null) {
                    serializerFactory = "org.apache.axis.encoding.ser.SimpleSerializerFactory";
                    deserializerFactory = "org.apache.axis.encoding.ser.SimpleDeserializerFactory";
                } else {
                    serializerFactory = "org.apache.axis.encoding.ser.BeanSerializerFactory";
                    deserializerFactory = "org.apache.axis.encoding.ser.BeanDeserializerFactory";
View Full Code Here

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

                        node, symbolTable);
                if (v != null) {
                    typeWriter = getEnumTypeWriter(emitter, type, v);
                }
                else {
                    TypeEntry base = SchemaUtils.getComplexElementExtensionBase(
                       node, symbolTable);
                    if (base == null) {
                        QName baseQName = SchemaUtils.getSimpleTypeBase(
                           node);
                        if (baseQName != null) {
View Full Code Here

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

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

            boolean wroteFieldType = false;
            pw.println("    static {");

            if (attributes != null) {
                for (int i = 0; i < attributes.size(); i += 2) {
                    TypeEntry te = (TypeEntry) attributes.get(i);
                    QName attrName = (QName) attributes.get(i + 1);
                    String attrLocalName = attrName.getLocalPart();
                    String fieldName = Utils.xmlNameToJava(attrLocalName);
                    fieldName = getAsFieldName(fieldName);
                    QName attrXmlType = te.getQName();
                    pw.print("        ");
                    if (!wroteFieldType) {
                        pw.print("org.apache.axis.description.FieldDesc ");
                        wroteFieldType = true;
                    }
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.