Package org.apache.axis.wsdl.symbolTable

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


                if (SchemaUtils.isMixed(parent.getNode())) {
                    parentIsMixed = true;
                }
                Vector hisElements = parent.getContainedElements();
                for (int i = 0; hisElements != null && i < hisElements.size(); i++) {
                    ElementDecl elem = (ElementDecl) hisElements.get(i);
                    if (elem.getAnyElement()) {
                        parentIsAny = true;
                    }
                }

                parent =
                    SchemaUtils.getComplexElementExtensionBase(parent.getNode(),
                            emitter.getSymbolTable());
            }

            for (int i = 0; i < elements.size(); i++) {
                ElementDecl elem = (ElementDecl) elements.get(i);
                String typeName = elem.getType().getName();
                String variableName = null;

                if (elem.getAnyElement()) {
                    if (!parentIsAny && !parentIsMixed) {
                        typeName = "org.apache.axis.message.MessageElement []";
                        variableName = Constants.ANYCONTENT;
                    }
                    isAny = true;
                } else {
                    variableName = elem.getName();
                    typeName = processTypeName(elem, typeName);
                }

                if (variableName == null) {
                    continue;
                }

                // Make sure the property name is not reserved.
                variableName = JavaUtils.getUniqueValue(
                        helper.reservedPropNames, variableName);
                names.add(typeName);
                names.add(variableName);

                if (type.isSimpleType()
                        && (variableName.endsWith("Value")
                        || variableName.equals("_value"))) {
                    simpleValueTypes.add(typeName);
                }

                // bug 19069: need to generate code that access member variables that
                // are enum types through the class interface, not the constructor
                // this util method returns non-null if the type at node is an enum
                if (null != Utils.getEnumerationBaseAndValues(
                        elem.getType().getNode(), emitter.getSymbolTable())) {
                    enumerationTypes.add(typeName);
                }
            }
        }
View Full Code Here


     */
    protected TypeEntry getElementDecl(String elementName)
    {
        if (elements != null) {
            for (int i = 0; i < elements.size(); i++) {
                ElementDecl elem = (ElementDecl) elements.get(i);
                String variableName;

                if (elem.getAnyElement()) {
                    variableName = Constants.ANYCONTENT;
                } else {
                    variableName = elem.getName();
                }

                if (variableName.equals(elementName))
        return elem.getType();
      }
  }
  return null;
    }
View Full Code Here

            String comments = "";
            if (elements != null)
            {
                if (elements != null && i < (elements.size()*2))
                {
                    ElementDecl elem = (ElementDecl)elements.get(i/2);
                    comments = elem.getDocumentation();
                }
            }
           
            String typeName = (String) names.get(i);
            String variable = (String) names.get(i + 1);
View Full Code Here

            // Process the elements
            Vector elements = te.getContainedElements();

            if (elements != null) {
                for (int j = 0; j < elements.size(); j++) {
                    ElementDecl elem = (ElementDecl) elements.get(j);

                    if (elem.getAnyElement()) {
                        if (!gotAny) {
                            gotAny = true;
                            paramTypes.add("org.apache.axis.message.MessageElement []");
                            paramNames.add(Constants.ANYCONTENT);
                        }
                    } else {
                        paramTypes.add(processTypeName(elem,elem.getType().getName()));
                        String name = elem.getName() == null ? ("param" + i) : elem.getName();
                        paramNames.add(JavaUtils.getUniqueValue(
                            helper.reservedPropNames, name));
                    }
                }
            }
View Full Code Here

            String documentation = "";
            if (elements != null)
            {
                if (elements != null && i < (elements.size()*2))
                {
                    ElementDecl elem = (ElementDecl)elements.get(i/2);
                    documentation = elem.getDocumentation();
                }
            }
           
            String get = "get";

            if (typeName.equals("boolean")) {
                get = "is";
            }

            String comment = getJavadocDescriptionPart(documentation, true);
            if (comment.length() > 3) {
                // remove the " *" at the front of the first line
                comment = comment.substring(2);
            }
            if (enableGetters) {
                try {
                    pw.println();
                    pw.println("    /**");
                    pw.println("     * Gets the " + name + " value for this " + getClassName() + ".");
                    pw.println("     * ");
                    pw.println("     * @return " + name + comment);
                    pw.println("     */");
                } catch (DOMException e) {
                    // no comment
                }                   
                pw.println("    public " + typeName + " " + get + capName
                        + "() {");

                if (isUnion()) {
                    writeSimpleTypeGetter(typeName, name, "return");
                } else {
                    pw.println("        return " + name + ";");
                }

                pw.println("    }");
                pw.println();
            }

            if (enableSetters) {
                try
                {
                    String nm = (isUnion()) ? "_value" : name;
                    pw.println();
                    pw.println("    /**");
                    pw.println("     * Sets the " + nm + " value for this " + getClassName() + ".");
                    pw.println("     * ");
                    pw.println("     * @param " + nm + comment);
                    pw.println("     */");
                }
                catch (DOMException e)
                {
                    // no comment
                }                   
                if (isUnion()) {
                    pw.println("    public void set" + capName + "(" + typeName
                            + " _value) {");
                    writeSimpleTypeSetter(typeName);
                } else {
                    pw.println("    public void set" + capName + "(" + typeName
                            + " " + name + ") {");
                    pw.println("        this." + name + " = " + name + ";");
                }

                pw.println("    }");
                pw.println();
            }

            // If this is a special collection type, insert extra
            // java code so that the serializer/deserializer can recognize
            // the class.  This is not JAX-RPC, and will be replaced with
            // compliant code when JAX-RPC determines how to deal with this case.
            // These signatures comply with Bean Indexed Properties which seems
            // like the reasonable approach to take for collection types.
            // (It may be more efficient to handle this with an ArrayList...but
            // for the initial support it was easier to use an actual array.)
            if ((elements != null) && (j < elements.size())) {
                ElementDecl elem = (ElementDecl) elements.get(j);

                if (elem.getType().getQName().getLocalPart().indexOf("[") > 0) {
                    String compName =
                            typeName.substring(0, typeName.lastIndexOf("["));

                    if (enableGetters) {
                        pw.println("    public " + compName + " " + get
View Full Code Here

          Vector elements = SchemaUtils.getContainedElementDeclarations(
                      te.getNode(), symbolTable);
          if (elements != null) {
            for (int j=0; j<elements.size(); j++) {
              ElementInfo eleinfo = null;
              ElementDecl elem = (ElementDecl)elements.get(j);
              if (elem.getAnyElement()){
             
                Type anyType = new Type(CUtils.anyTypeQname, CUtils.anyTypeQname.getLocalPart(), true, targetLanguage);
                eleinfo = new ElementInfo(elem.getName(),anyType);             
              }
              else{
                QName typeName = elem.getType().getQName();
                if(typeName.getLocalPart().indexOf('[')>0){
                  String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                  typeName = new QName(typeName.getNamespaceURI(),localpart);
                  if (CUtils.isBasicType(typeName)){
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
                  }
                  else{
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage));
                  }
                }
                else{
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));               
                }
              }
              eleinfo.setMinOccurs(elem.getMinOccrs());
              eleinfo.setMaxOccurs(elem.getMaxOccurs());
              typedata.setTypeNameForElementName(eleinfo);
            }     
          }
        }
      }
View Full Code Here

    protected void preprocess() {

        // Add element names
        if (elements != null) {
            for (int i = 0; i < elements.size(); i++) {
                ElementDecl elem = (ElementDecl) elements.get(i);
                String typeName = elem.getType().getName();
                String variableName;

                if (elem.getAnyElement()) {
                    typeName = "org.apache.axis.message.MessageElement []";
                    variableName = Constants.ANYCONTENT;
                    isAny = true;
                } else {
                    String elemName = Utils.getLastLocalPart(elem.getName().getLocalPart());
                    variableName = Utils.xmlNameToJava(elemName);
                   
                    if (elem.getMinOccursIs0() || elem.getNillable()) {
                        typeName = Utils.getWrapperType(typeName);
                    }
                }

                names.add(typeName);
                names.add(variableName);

                if (type.isSimpleType()
                        && (variableName.endsWith("Value")
                        || variableName.equals("_value"))) {
                    simpleValueTypes.add(typeName);
                }

                // bug 19069: need to generate code that access member variables that
                // are enum types through the class interface, not the constructor
                // this util method returns non-null if the type at node is an enum
                if (null != Utils.getEnumerationBaseAndValues(
                        elem.getType().getNode(), emitter.getSymbolTable())) {
                    enumerationTypes.add(typeName);
                }
            }
        }
View Full Code Here

            String comments = "";
            if (elements != null)
            {
                if (elements != null && i < (elements.size()*2))
                {
                    ElementDecl elem = (ElementDecl)elements.get(i/2);
                    comments = elem.getDocumentation();
                }
            }
           
            String typeName = (String) names.get(i);
            String variable = (String) names.get(i + 1);
View Full Code Here

                    SchemaUtils.getContainedElementDeclarations(te.getNode(),
                            emitter.getSymbolTable());

            if (elements != null) {
                for (int j = 0; j < elements.size(); j++) {
                    ElementDecl elem = (ElementDecl) elements.get(j);
                    String name = Utils.getLastLocalPart(elem.getName().getLocalPart());
                    paramTypes.add(elem.getType().getName());
                    paramNames.add(
                            mangle
                            + Utils.xmlNameToJava(name));
                }
            }
View Full Code Here

            String documentation = "";
            if (elements != null)
            {
                if (elements != null && i < (elements.size()*2))
                {
                    ElementDecl elem = (ElementDecl)elements.get(i/2);
                    documentation = elem.getDocumentation();
                }
            }
           
            String get = "get";

            if (typeName.equals("boolean")) {
                get = "is";
            }

            String comment = getJavadocDescriptionPart(documentation, false);
            if (comment.length() > 3) {
                // remove the " *" at the front of the first line
                comment = comment.substring(2);
            }
            if (enableGetters) {
                try {
                    pw.println();
                    pw.println("    /**");
                    pw.println("     * Gets the " + name + " value for this " + getClassName() + ".");
                    pw.println("     * ");
                    pw.println("     * @return " + name + comment);
                    pw.println("     */");
                } catch (DOMException e) {
                    // no comment
                }                   
                pw.println("    public " + typeName + " " + get + capName
                        + "() {");

                if (isUnion()) {
                    writeSimpleTypeGetter(typeName, name, "return");
                } else {
                    pw.println("        return " + name + ";");
                }

                pw.println("    }");
                pw.println();
            }

            if (enableSetters) {
                try
                {
                    pw.println();
                    pw.println("    /**");
                    pw.println("     * Sets the " + name + " value for this " + getClassName() + ".");
                    pw.println("     * ");
                    pw.println("     * @param " + name + comment);
                    pw.println("     */");
                }
                catch (DOMException e)
                {
                    // no comment
                }                   
                if (isUnion()) {
                    pw.println("    public void set" + capName + "(" + typeName
                            + " _value) {");
                    writeSimpleTypeSetter(typeName);
                } else {
                    pw.println("    public void set" + capName + "(" + typeName
                            + " " + name + ") {");
                    pw.println("        this." + name + " = " + name + ";");
                }

                pw.println("    }");
                pw.println();
            }

            // If this is a special collection type, insert extra
            // java code so that the serializer/deserializer can recognize
            // the class.  This is not JAX-RPC, and will be replaced with
            // compliant code when JAX-RPC determines how to deal with this case.
            // These signatures comply with Bean Indexed Properties which seems
            // like the reasonable approach to take for collection types.
            // (It may be more efficient to handle this with an ArrayList...but
            // for the initial support it was easier to use an actual array.)
            if ((elements != null) && (j < elements.size())) {
                ElementDecl elem = (ElementDecl) elements.get(j);

                if (elem.getType().getQName().getLocalPart().indexOf("[") > 0) {
                    String compName =
                            typeName.substring(0, typeName.lastIndexOf("["));

                    if (enableGetters) {
                        pw.println("    public " + compName + " " + get
View Full Code Here

TOP

Related Classes of org.apache.axis.wsdl.symbolTable.ElementDecl

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.