Package org.apache.axis.wsdl.symbolTable

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


     */
    protected void writeFullConstructor() {
        // The constructor needs to consider all extended types
        Vector extendList = new Vector();
        extendList.add(type);
        TypeEntry parent = extendType;
        while(parent != null) {
            extendList.add(parent);
            parent = SchemaUtils.getComplexElementExtensionBase(
                parent.getNode(),
                emitter.getSymbolTable());
        }

        // Now generate a list of names and types starting with
        // the oldest parent.  (Attrs are considered before elements).
        Vector paramTypes = new Vector();
        Vector paramNames = new Vector();
        for (int i=extendList.size()-1; i >= 0; i--) {
            TypeEntry te = (TypeEntry) extendList.elementAt(i);

            // 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 = SchemaUtils.getContainedAttributeTypes(
                te.getNode(), emitter.getSymbolTable());
            if (attributes != null) {
                for (int j=0; j<attributes.size(); j+=2) {
                    paramTypes.add(((TypeEntry) attributes.get(j)).getName());
                    String name = ((QName)attributes.get(j + 1)).getLocalPart();
                    paramNames.add(mangle + Utils.xmlNameToJava(name));
                }
            }
            // Process the elements
            Vector elements = SchemaUtils.getContainedElementDeclarations(
                te.getNode(), emitter.getSymbolTable());
            if (elements != null) {
                for (int j=0; j<elements.size(); j++) {
                    ElementDecl elem = (ElementDecl)elements.get(j);
                    paramTypes.add(elem.getType().getName());
                    paramNames.add(mangle +
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.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

        if (types.size() > 0 || hasMIME) {
            writeSerializationDecls(pw, hasMIME, binding.getQName().getNamespaceURI());
            Iterator it = types.iterator();
            while (it.hasNext()) {
                TypeEntry te = (TypeEntry) it.next();
                writeSerializationInit(pw, te);
            }
        }

        pw.println("        }");
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

            }

            // 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.getTypeQName(restrictionNode, new BooleanHolder(), false);
                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

     */
    private Object getParamData(org.apache.axis.client.Call c, Parameter p, String arg) throws Exception {
        // Get the QName representing the parameter type
        QName paramType = org.apache.axis.wsdl.toJava.Utils.getXSIType(p);

        TypeEntry type = p.getType();
        if (type instanceof BaseType && ((BaseType) type).isBaseType()) {
            DeserializerFactory factory = c.getTypeMapping().getDeserializer(paramType);
            Deserializer deserializer = factory.getDeserializerAs(Constants.AXIS_SAX);
            if (deserializer instanceof SimpleDeserializer) {
                return ((SimpleDeserializer)deserializer).makeValue(arg);
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())){
        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.equals("boolean") ||
            ! SchemaUtils.isSimpleSchemaType(baseEType.getQName())) {
            baseEType = null;
          }
        }
      }
View Full Code Here

     * This method extract the custom complex type info fom the symbol table
     * @return the type map with type info
     */
    private TypeMap getTypeInfo(String targetLanguage)throws WrapperFault {
        Iterator it = symbolTable.getTypeIndex().values().iterator();
        TypeEntry type;
        Iterator elements;
        Type typedata;

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

            }
        } //end of type while
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.