Package org.apache.axis.wsdl.symbolTable

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


    protected void writeDeployTypes(PrintWriter pw, boolean hasLiteral) throws IOException {
        Vector types = symbolTable.getTypes();

        pw.println();
        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 CollectionType ||
                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.SimpleNonPrimitiveSerializerFactory";
                    deserializerFactory = "org.apache.axis.encoding.ser.SimpleDeserializerFactory";
                } else if (type.getBaseType() != null) {
                    serializerFactory = "org.apache.axis.encoding.ser.SimplePrimitiveSerializerFactory";
                    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


        pw.println(" >");

        Vector paramList = params.list;
        for (int i = 0; i < paramList.size(); i++) {
            Parameter param = (Parameter) paramList.elementAt(i);
            TypeEntry typeEntry = param.getType();

            QName paramQName = null;
            QName paramType = null;

            // Get the parameter type QName
            if (typeEntry instanceof DefinedElement &&
                typeEntry.getRefType() != null) {
                paramType = typeEntry.getRefType().getQName();
            } else {
                paramType = typeEntry.getQName();
            }

            // Get the parameter name QName
            paramQName = param.getQName();
View Full Code Here

                        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, symbolTable);
                        if (baseQName != null) {
View Full Code Here

            }

            // The restriction node indicates the type being restricted
            // (the base attribute contains this type).
            // The base type must be a built-in type, and not boolean
            TypeEntry baseEType = null;
            if (restrictionNode != null) {
                QName baseType = Utils.getNodeTypeRefQName(restrictionNode, "base");
                baseEType = symbolTable.getType(baseType);
                if (baseEType != null) {
                    String javaName = baseEType.getName();
                    if (javaName.equals("java.lang.String") ||
                        javaName.equals("java.math.BigInteger") ||
                        javaName.equals("java.math.BigDecimal") ||
                        javaName.equals("int") ||
                        javaName.equals("long") ||
View Full Code Here

     * If generating serverside (skeleton) spit out beanmappings
     */
    private void generateTypes(SymbolTable symbolTable) throws IOException {
        Vector types = symbolTable.getTypes();
        for (int i = 0; i < types.size(); ++i) {
            TypeEntry type = (TypeEntry) types.elementAt(i);

            // Write out the type if and only if:
            //  - we found its definition (getNode())
            //  - it is referenced
            //  - it is not a base type
            //  - it is a Type (not an Element)
            // (Note that types that are arrays are passed to getGenerator
            //  because they may require a Holder)
            if (type.getNode() != null &&
                type instanceof Type &&
                type.isReferenced() &&
                type.getBaseType() == null) {
                Generator gen = genFactory.getGenerator(type, symbolTable);
                gen.generate();
            }
        }
    } // generateTypes
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

        Iterator iterator = symbolTable.getElementIndex().entrySet().iterator();

        while (iterator.hasNext()) {
            Map.Entry me = (Map.Entry) iterator.next();
            QName name = (QName) me.getKey();
            TypeEntry te = (TypeEntry) me.getValue();
            String prefix = XMLUtils.getPrefix(name.getNamespaceURI(),
                    te.getNode());

            if (!((null == prefix) || "".equals(prefix))) {
                namespaces.putPrefix(name.getNamespaceURI(), prefix);
                def.addNamespace(prefix, name.getNamespaceURI());
            }

            addToElementsList(name);
        }

        iterator = symbolTable.getTypeIndex().entrySet().iterator();

        while (iterator.hasNext()) {
            Map.Entry me = (Map.Entry) iterator.next();
            QName name = (QName) me.getKey();
            TypeEntry te = (TypeEntry) me.getValue();
            String prefix = XMLUtils.getPrefix(name.getNamespaceURI(),
                    te.getNode());

            if (!((null == prefix) || "".equals(prefix))) {
                namespaces.putPrefix(name.getNamespaceURI(), prefix);
                def.addNamespace(prefix, name.getNamespaceURI());
            }
View Full Code Here

        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 or attributeGroups.
                // 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()
                        || ((type.getNode() != null)
                        && type.getNode().getLocalName().equals(
                                "attributeGroup"))) {
                    continue;
                }

                // Write out serializer declarations
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(type.getNestedTypes(symbolTable, true));
            }
        }

     if(emitter.isAllWanted()) {
       HashMap rawSymbolTable = symbolTable.getHashMap();
       for(Iterator j = rawSymbolTable.values().iterator(); j.hasNext(); ) {
         Vector typeVector = (Vector)j.next();
         for(Iterator k = typeVector.iterator(); k.hasNext(); ) {
           Object symbol = k.next();
           if(symbol instanceof DefinedType) {
             TypeEntry type = (TypeEntry)symbol;
             if(!types.contains(type)) {
               types.add(type);
             }
           }
         }
View Full Code Here

     */
    private void writeOutputAssign(PrintWriter pw, String target,
                                   Parameter param,
                                   String source) {

        TypeEntry type = param.getType();
       
        if ((type != null) && (type.getName() != null)) {
            String typeName = type.getName();
            if (param.isOmittable()) {
                typeName = Utils.getWrapperType(type.getName());
            }

            // Try casting the output to the expected output.
            // If that fails, use JavaUtils.convert()
            pw.println("            try {");
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.