Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaField


        }
      }
      else {
        runtimeType = pController.getRuntimeType();
      }
      JavaField jf = pSource.newJavaField(pFieldName, runtimeType, JavaSource.PRIVATE);
      if (!pController.isComplex()) {
        Object o = pController.getSimpleTypeSG().getInitialValue(pSource);
        if (o == null && pDefaultValue != null) {
            o = pController.getSimpleTypeSG().getCastFromString(pDefaultValue);
        }
        if (o != null) {
            jf.addLine(o);
        }
      }
      return jf;
    }
  }
View Full Code Here


                                    String pFieldName, String pMethodName)
      throws SAXException {
    JavaMethod jm = pSource.newJavaMethod(pMethodName, BooleanSG.BOOLEAN_TYPE, JavaSource.PUBLIC);
    if (!pSource.isInterface()) {
      if (pController.getRuntimeType().isPrimitive()) {
        JavaField jf = pSource.newJavaField(getIsSetCheckFieldName(pFieldName), BooleanSG.BOOLEAN_TYPE);
        jm.addLine("return ", jf, ";");
      } else {
        jm.addLine("return (" + pFieldName + " != null);");
      }
    }
View Full Code Here

        JavaQName typeQName = getQName(typeName);
        return pSource.newJavaField(fieldName, typeName, JavaSource.DEFAULT_PROTECTION);
    }

    private void parseFieldDefinition(JavaSource pSource, AST pAST) {
      JavaField jf = getJavaField(pSource, pAST);
        parseModifiers(jf, pAST);
    }
View Full Code Here

        }
        return jm;
    }

    protected JavaField getXmlRpcCaller(JavaSource pJs) {
      JavaField jf = pJs.newJavaField("caller", XmlRpcCaller.class, JavaSource.PRIVATE);
        jf.setFinal(true);
        return jf;
    }
View Full Code Here

     * server side class <code>pSource</code>.
     */
    public JavaSource addClass(JavaSource pSource, JavaSourceResolver pResolver)
            throws SecurityException, NoSuchMethodException {
        JavaSource js = getFactory().newJavaSource(JavaQNameImpl.getInstance(getTargetPackage(), pSource.getQName().getClassName()), JavaSource.PUBLIC);
        JavaField jf = getXmlRpcCaller(js);
        getConstructor(js, jf);
        Map keys = new HashMap();
        addMethods(js, pSource, keys, jf, pResolver);
        return js;
    }
View Full Code Here

    }

    /** Creates the field with the {@link Map} of invokers.
     */
    protected JavaField getInvokerMap(JavaSource pSource) {
      JavaField result = pSource.newJavaField("map", Map.class, JavaSource.PRIVATE);
      result.addLine("new ", HashMap.class, "()");
        return result;
    }
View Full Code Here

        comment.addLine("It delegates incoming XML-RPC calls to the classes");
        comment.addLine("and methods, for which client classes have been");
        comment.addLine("created by the " +
                        XmlRpcClientGenerator.class.getName() + ".");
        JavaSource invoker = getInvokerClass(js);
        JavaField map = getInvokerMap(js);
        getDispatcherConstructor(js, map, invoker.getQName());
        getGetInvokerMethod(js, invoker.getQName(), map);
        getDispatcherInvokeMethod(js, invoker.getQName());
        return js;
    }
View Full Code Here

        jm.addThrows(JAXBException.class);
      }
      String serializerName = getXMLSerializersFieldName(particle.getPropertySG());
      Context myClassContext = child.getTypeSG().getComplexTypeSG().getClassContext();
      JavaQName serializerClass = myClassContext.getXMLSerializerName();
      JavaField jf = pSource.newJavaField(serializerName, serializerClass, JavaSource.PRIVATE);
      JavaQName elementInterface = myClassContext.getXMLInterfaceName();
      if (child.getTypeSG().isGlobalClass()) {
        jm.addLine(jf, " = (", serializerClass, ") ", pFactory, ".getJMXmlSerializer(", elementInterface, ".class);");
      } else {
        jm.addLine(jf, " = new ", serializerClass, "();");
View Full Code Here

          String f = particle.getPropertySG().getXMLFieldName();
          String handlerFieldName = "__handler_" + f;
          String handlerMethodName = getXMLHandlersMethodName(particle.getPropertySG());

          JavaField jf = pSource.newJavaField(handlerFieldName, JMHandler.class, JavaSource.PRIVATE);
          JavaMethod jm2 = pSource.newJavaMethod(handlerMethodName, JMHandler.class, "protected");
          jm2.addThrows(SAXException.class);
          jm2.addIf(handlerFieldName, " == null");
         
          ComplexTypeSG childSG = typeSG.getComplexTypeSG();
View Full Code Here

  }

  private JavaField getXMLHandlersStateField(GroupSG pController, JavaSource pSource) throws SAXException {
    ParticleSG[] myParticles = pController.getParticles();
    if (myParticles.length > 0) {
      JavaField jf = pSource.newJavaField("__state", int.class, JavaSource.PRIVATE);
      JavaComment jc = jf.newComment();
      jc.addLine("The current state. The following values are valid states:");
      jc.addLine(" 0 = Before parsing the element");
      jc.addLine(" 1 = Parsing an unknown element");
      jc.addLine(" 2 = After parsing the element");
      for (int i = 0;  i < myParticles.length;  i++) {
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.js.JavaField

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.