Package org.apache.axis.wsdl.symbolTable

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


            String bindingType = (String) bEntry.getDynamicVar(JavaBindingWriter.INTERFACE_NAME);
            writeBindingAssignment(pw, bindingType, portName);

            pw.println("        try {");
            if (params.returnParam != null) {
                TypeEntry returnType = params.returnParam.getType();
                pw.print("            ");
                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


            }

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

                    "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

                 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

        } 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();
            }

            // Determine if the te should be processed using the
            // simple type mapping or the complex type mapping
            if (te.getBaseType() != null ||
                te.isSimpleType()) {
                // 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

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

                                    (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

        // keep track of how many type mappings we write out
        int typeMappingCount = 0;
        if (types.size() > 0) {
            Iterator it = types.iterator();
            while (it.hasNext()) {
                TypeEntry type = (TypeEntry) it.next();
                // Note this same check is repeated in JavaDeployWriter.

                // 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 elements
                // 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()) {
                    continue;
                }
       
                // Write out serializer declarations
                if (typeMappingCount == 0) {
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

        // Walk the type/element entries in the symbol table and
        // add each one to the list of processed types.  This prevents
        // the types from being duplicated.
        Vector v = symbolTable.getTypes();
        for (int i=0; i < v.size(); i++) {
            TypeEntry te = (TypeEntry) v.elementAt(i);
            if (te instanceof org.apache.axis.wsdl.symbolTable.Element) {
                addToElementsList(te.getQName());
            } else if (te instanceof Type) {
                addToTypesList(te.getQName());
            }
        }

   
    }
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.