Package org.apache.axis.wsdl.symbolTable

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


     * 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) or a CollectionElement
            // (Note that types that are arrays are passed to getGenerator
            //  because they may require a Holder)

            // A CollectionElement is an array that might need a holder
            boolean isType = (type instanceof Type ||
                    type instanceof CollectionElement);
            if (type.getNode() != null &&
                    type.isReferenced() &&
                    isType &&
                    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 = TypeMap.getBasicTypeClass4qname(baseEType.getQName());
          //String javaName = baseEType.getName();
          if (javaName.equals("boolean") ||
            ! SchemaUtils.isSimpleSchemaType(baseEType.getQName())) {
            baseEType = null;
          }
        }
      }
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) or a CollectionElement
            // (Note that types that are arrays are passed to getGenerator
            //  because they may require a Holder)

            // A CollectionElement is an array that might need a holder
            boolean isType = (type instanceof Type ||
                    type instanceof CollectionElement);
            if (type.getNode() != null &&
                    type.isReferenced() &&
                    isType &&
                    type.getBaseType() == null) {
                Generator gen = genFactory.getGenerator(type, symbolTable);
                gen.generate();
            }
        }
    } // generateTypes
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(),
                               te.getQName().getLocalPart());
            }
        }

   
    }
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

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                // Use the type or the referenced type's QName to generate the java name.     
                if (entry instanceof TypeEntry && entry.getName() == null) {
                    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

            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

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.