Package org.apache.ws.jaxme.js

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


    TypeSG myTypeSG = pController.getTypeSG();
    if (!myTypeSG.isComplex()) {
      log.finest(mName, "<-", null);
      return null;
    } else {
      JavaQName xmlHandlerName = pController.getClassContext().getXMLHandlerName();
      JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
      JavaSource js = jsf.newJavaSource(xmlHandlerName, JavaSource.PUBLIC);
      js.addImplements(JMHandler.class);
      if (myTypeSG.isGlobalClass()) {
        Context typeContext = myTypeSG.getComplexTypeSG().getClassContext();
        js.addExtends(typeContext.getXMLHandlerName());
        JavaQName xmlElementInterface = pController.getClassContext().getXMLInterfaceName();
        JavaQName resultInterface = typeContext.getXMLInterfaceName();
        JavaMethod jm = js.newJavaMethod("newResult", resultInterface, JavaSource.PROTECTED);
        jm.addThrows(SAXException.class);
        jm.addTry();
        jm.addLine("return (", resultInterface, ") getData().getFactory().getElement(",
                   xmlElementInterface, ".class);");
View Full Code Here


    }
    if (className.equals("EmailDetailsType")) {
      throw new IllegalStateException();
    }

    JavaQName xmlInterfaceName = JavaQNameImpl.getInstance(packageName, className);
    setXMLInterfaceName(xmlInterfaceName);

    if (implementationName == null) {
      setXMLImplementationName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                                         xmlInterfaceName.getClassName() + "Impl"));
    } else {
      setXMLImplementationName(JavaQNameImpl.getInstance(implementationName, true));
    }
    setXMLHandlerName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                                xmlInterfaceName.getClassName() + "Handler"));
    setXMLSerializerName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                                   xmlInterfaceName.getClassName() + "Serializer"));
    setXMLValidatorName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                                  xmlInterfaceName.getClassName() + "Validator"));
    setPMName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                        xmlInterfaceName.getClassName() + "PM"));
  }
View Full Code Here

    list.addLine(pController.getValue(pElement));
    DirectAccessible i = pMethod.addForList(list);
    TypeSG typeSG = objectSG.getTypeSG();
    Object v;
    boolean isCasting = !OBJECT_TYPE.equals(typeSG.getRuntimeType());
    JavaQName qName = typeSG.getRuntimeType();
    if (isCasting  &&  pSGlet instanceof SGlet.TypedSGlet) {
      SGlet.TypedSGlet typedSGlet = (SGlet.TypedSGlet) pSGlet;
      isCasting = typedSGlet.isCasting();
      if (typedSGlet.getType() != null) {
        qName = typedSGlet.getType();
View Full Code Here

    if (i > 0) instanceList.add(", ");
     instanceList.add(instance);
    }

   JavaQName arrayType = JavaQNameImpl.getArray(pSource.getQName());
   JavaField allInstances = pSource.newJavaField("allInstances", arrayType,
                                                  JavaSource.PRIVATE);
   allInstances.setStatic(true);
   allInstances.setFinal(true);
   allInstances.addLine("new ", arrayType, "{", instanceList, "}");
View Full Code Here

   }

   /** <p>Sets the interface name being generated for the chain objects.</p>
    */
   public void setChainInterfaceName(String pInterfaceName) {
      JavaQName qName = JavaQNameImpl.getInstance(pInterfaceName, true);
      setChainInterface(qName);
   }
View Full Code Here

   }

   /** <p>Sets the class name being generated for the chain objects.</p>
    */
   public void setProxyClassName(String pClassName) {
      JavaQName qName = JavaQNameImpl.getInstance(pClassName, true);
      setProxyClass(qName);
   }
View Full Code Here

   /** <p>Returns the class being generated for the chain objects. Defaults
    * to <code>getChainInterface() + "Impl"</code>.</p>
    */
   public JavaQName getProxyClass() {
      if (proxyClass == null) {
         JavaQName chainClass = getChainInterface();
         if (chainClass == null) {
            return null;
         } else {
            return JavaQNameImpl.getInstance(chainClass.getPackageName(),
                                                             chainClass.getClassName() + "Impl");
         }
      } else {
         return proxyClass;
      }
   }
View Full Code Here

   public JavaQName getImplementationClass() {
      if (implClass == null) {
         if (controllerInterface == null) {
            return null;
         } else {
            JavaQName controllerClass = JavaQNameImpl.getInstance(controllerInterface);
            return JavaQNameImpl.getInstance(controllerClass.getPackageName(),
                                              controllerClass.getClassName() + "Impl");
         }
      } else {
         return implClass;
      }
   }
View Full Code Here

         public JavaMethod getInterfaceMethod(JavaSource pSource,
                                               ProxyGenerator.InterfaceDescription pDescription,
                                               java.lang.reflect.Method pMethod) {
           JavaMethod jm = pSource.newJavaMethod(pMethod);
           Parameter[] parameters = jm.getParams();
           JavaQName controllerInterfaceQName = JavaQNameImpl.getInstance(getControllerInterface());
           jm.clearParams();
           jm.addParam(controllerInterfaceQName, "pController");
           for (int i = 0;  i < parameters.length;  i++) {
              jm.addParam(parameters[i]);
           }
           return jm;
         }
         public JavaSource generate(JavaSourceFactory pInterfaceFactory,
                                     JavaQName pTargetClass,
                                     ProxyGenerator.InterfaceDescription[] pDescription) {
            JavaSource result = super.generate(pInterfaceFactory, pTargetClass,
                                               pDescription);
            result.clearImplements();
            return result;
         }
      };
      JavaSource proxyInterface = proxyInterfaceGenerator.generate(pFactory, getChainInterface(), interfaces);
      proxyInterface.setType(JavaSource.INTERFACE);

      ProxyGenerator proxyImplementationGenerator = new ProxyGenerator(){
         protected JavaField getBackingObjectField(JavaSource pJs, InterfaceDescription[] pInterfaces) {
            return pJs.newJavaField("backingObject", getChainInterface(), JavaSource.PRIVATE);
         }
         protected JavaConstructor getConstructor(JavaSource pJs,
                                                   InterfaceDescription[] pInterfaces) {
            JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PROTECTED);
            jcon.addParam(getChainInterface(), "o");
            jcon.addIf("o == null");
            jcon.addThrowNew(NullPointerException.class,
                             JavaSource.getQuoted("The supplied object must not be null."));
            jcon.addEndIf();
            jcon.addLine("backingObject = o;");
            return jcon;
         }

         public JavaMethod getInterfaceMethod(JavaSource pSource,
                                               ProxyGenerator.InterfaceDescription pDescription,
                                               java.lang.reflect.Method pMethod) {
            JavaMethod jm = pSource.newJavaMethod(pMethod);
            Parameter[] parameters = jm.getParams();
            JavaQName controllerInterfaceQName = JavaQNameImpl.getInstance(getControllerInterface());
            jm.clearParams();
            jm.addParam(controllerInterfaceQName, "pController");
            for (int i = 0;  i < parameters.length;  i++) {
               jm.addParam(parameters[i]);
            }
View Full Code Here

        params.add(", ");
      }
      params.add(new Object[]{pValues, "[" + index + "]"});
    }

    JavaQName cacheDataClass = getCacheDataClassName(pMethod.getJavaSource().getQName());
    LocalJavaField jf = pMethod.newJavaField(cacheDataClass);
    jf.addLine("new ", cacheDataClass, "(",

    JavaSource.getQuoted(pTableInfo.getPropertyName()),
                         ", new ", Object[].class, "{", params, "})");
View Full Code Here

TOP

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

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.