Package org.codehaus.jam

Examples of org.codehaus.jam.JAnnotation


    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
      String propname = toPropertyCase(property.getSimpleName());
      boolean cached = isCachedProperty(property);
      JAnnotation annotation = property.getGetter().getAnnotation("openwire:property");
      JAnnotationValue size = annotation.getValue("size");

           type = property.getType().getQualifiedName();
           if( type.equals("boolean")) {
out.println("   ow_bit_buffer_append(buffer, object->"+propname+");");
                   } else if( type.equals("byte")) {
                   } else if( type.equals("char")) {
                   } else if( type.equals("short")) {
                   } else if( type.equals("int")) {
                   } else if( type.equals("long")) {
out.println("   ow_marshal1_long(buffer, object->"+propname+");");
                   } else if( type.equals("byte[]")) {
                     if( size ==null ) {
out.println("   ow_bit_buffer_append(buffer,  object->"+propname+"!=0 );");
                     }
                   } else if( type.equals("org.apache.activeio.packet.ByteSequence")) {
                     if( size ==null ) {
out.println("   ow_bit_buffer_append(buffer,  object->"+propname+"!=0 );");
                     }
                   } else if( type.equals("java.lang.String")) {
out.println("   ow_marshal1_string(buffer, object->"+propname+");");
                   } else {
                         if( property.getType().isArrayType() ) {
                           if( size!=null ) {
out.println("   SUCCESS_CHECK(ow_marshal1_DataStructure_array_const_size(buffer, object->"+propname+", "+size.asInt()+"));");
                           } else {
out.println("   SUCCESS_CHECK(ow_marshal1_DataStructure_array(buffer, object->"+propname+"));");
                           }
                         } else if( isThrowable(property.getType()) ) {         
out.println("   SUCCESS_CHECK(ow_marshal1_throwable(buffer, object->"+propname+"));");
                         } else {
                           if( cached ) {
out.println("   SUCCESS_CHECK(ow_marshal1_cached_object(buffer, (ow_DataStructure*)object->"+propname+"));");
                           } else {
out.println("   SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->"+propname+"));");
                           }
                       }
                   }
out.println("");
               }


out.println("   ");
out.println("  return APR_SUCCESS;");
out.println("}");
out.println("apr_status_t ow_marshal2_"+name+"(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_"+name+" *object)");
out.println("{");
out.println("   ow_marshal2_"+baseName+"(buffer, bitbuffer, (ow_"+baseName+"*)object);   ");

      for (Iterator iter = properties.iterator(); iter.hasNext();) {
        JProperty property = (JProperty) iter.next();
                   JAnnotation annotation = property.getGetter().getAnnotation("openwire:property");
                   JAnnotationValue size = annotation.getValue("size");
                   Object propname = toPropertyCase(property.getSimpleName());
                   boolean cached = isCachedProperty(property);
                  
                   type = property.getType().getQualifiedName();
                   if( type.equals("boolean") ) {
out.println("   ow_bit_buffer_read(bitbuffer);");
                   } else if( type.equals("byte") ) {
out.println("   SUCCESS_CHECK(ow_byte_buffer_append_"+type+"(buffer, object->"+propname+"));");
                   } else if( type.equals("char") ) {
out.println("   SUCCESS_CHECK(ow_byte_buffer_append_"+type+"(buffer, object->"+propname+"));");
                   } else if( type.equals("short") ) {
out.println("   SUCCESS_CHECK(ow_byte_buffer_append_"+type+"(buffer, object->"+propname+"));");
                   } else if( type.equals("int") ) {
out.println("   SUCCESS_CHECK(ow_byte_buffer_append_"+type+"(buffer, object->"+propname+"));");
                   } else if( type.equals("long") ) {
out.println("   SUCCESS_CHECK(ow_marshal2_long(buffer, bitbuffer, object->"+propname+"));");
                   } else if( type.equals("byte[]") ) {
                       if( size!=null ) {
out.println("   SUCCESS_CHECK(ow_marshal2_byte_array_const_size(buffer, object->"+propname+", "+size.asInt()+"));");
                       } else {
out.println("   SUCCESS_CHECK(ow_marshal2_byte_array(buffer, bitbuffer, object->"+propname+"));");
                       }
                   } else if( type.equals("org.apache.activeio.packet.ByteSequence") ) {
                       if( size!=null ) {
out.println("   SUCCESS_CHECK(ow_marshal2_byte_array_const_size(buffer, object->"+propname+", "+size.asInt()+"));");
                       } else {
out.println("   SUCCESS_CHECK(ow_marshal2_byte_array(buffer, bitbuffer, object->"+propname+"));");
                       }
                   } else if( type.equals("java.lang.String") ) {
out.println("   SUCCESS_CHECK(ow_marshal2_string(buffer, bitbuffer, object->"+propname+"));");
                   } else {
                      if( property.getType().isArrayType() ) {
                         if( size!=null ) {
out.println("   SUCCESS_CHECK(ow_marshal2_DataStructure_array_const_size(buffer, bitbuffer, object->"+propname+", "+size.asInt()+"));");
                         } else {
out.println("   SUCCESS_CHECK(ow_marshal2_DataStructure_array(buffer, bitbuffer, object->"+propname+"));");
                         }
                      } else if( isThrowable(property.getType()) ) {         
out.println("   SUCCESS_CHECK(ow_marshal2_throwable(buffer, bitbuffer, object->"+propname+"));");
                      } else {
                           if( cached ) {
out.println("   SUCCESS_CHECK(ow_marshal2_cached_object(buffer, bitbuffer, (ow_DataStructure*)object->"+propname+"));");
                           } else {
out.println("   SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->"+propname+"));");
                           }                     
                      }
                   }
out.println("");
               }

out.println("   ");
out.println("  return APR_SUCCESS;");
out.println("}");
out.println("");
out.println("apr_status_t ow_unmarshal_"+name+"(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_"+name+" *object, apr_pool_t *pool)");
out.println("{");
out.println("   ow_unmarshal_"+baseName+"(buffer, bitbuffer, (ow_"+baseName+"*)object, pool);   ");

  for (Iterator iter = properties.iterator(); iter.hasNext();) {
    JProperty property = (JProperty) iter.next();
                   JAnnotation annotation = property.getGetter().getAnnotation("openwire:property");
                   JAnnotationValue size = annotation.getValue("size");
                   String propname = toPropertyCase(property.getSimpleName());
                   boolean cached = isCachedProperty(property);
                  
                   type = property.getType().getQualifiedName();

View Full Code Here


    protected int generateTightMarshal1Body(PrintWriter out) {
        List properties = getProperties();
        int baseSize = 0;
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info." + property.getSimpleName();

            if (type.equals("boolean")) {
View Full Code Here

    protected void generateTightMarshal2Body(PrintWriter out) {
        List properties = getProperties();
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info." + property.getSimpleName();

            if (type.equals("boolean")) {
View Full Code Here

    protected void generateLooseMarshalBody(PrintWriter out) {
        List properties = getProperties();
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info." + property.getSimpleName();

            if (type.equals("boolean")) {
View Full Code Here

                             * then it will create Complex types for those , and if the
                             * parameters are simple type which decribe in SimpleTypeTable
                             * nothing will happen) 2. In the next stage for all the methods
                             * messages and port types will be creteated
                             */
                            JAnnotation annotation =
                                    jclass.getAnnotation(AnnotationConstants.WEB_SERVICE);
                            if (annotation != null) {
                                // try to see whether JAX-WS jars in the class path , if so use them
                                // to process annotated pojo else use annogen to process the pojo class
                                AxisService axisService;
                                axisService = createAxisService(classLoader,
                                                                className,deploymentFileData.getFile().toURL());
                                configCtx.getAxisConfiguration().addService(axisService);
                            } else {
                                AxisService axisService = createAxisServiceUsingAnnogen(className,
                                                                                        classLoader,
                                                                                        deploymentFileData.getFile().toURL());
                                configCtx.getAxisConfiguration().addService(axisService);
                            }
                        }
                    }
                }

            } else if ("jar".equals(extension)) {
                ArrayList classList;
                FileInputStream fin = null;
                ZipInputStream zin = null;
                try {
                    fin = new FileInputStream(deploymentFileData.getAbsolutePath());
                    zin = new ZipInputStream(fin);
                    ZipEntry entry;
                    classList = new ArrayList();
                    while ((entry = zin.getNextEntry()) != null) {
                        String name = entry.getName();
                        if (name.endsWith(".class")) {
                            classList.add(name);
                        }
                    }
                    zin.close();
                    fin.close();
                } catch (Exception e) {
                    throw new DeploymentException(e);
                } finally {
                    if (zin != null) {
                        zin.close();
                    }
                    if (fin != null) {
                        fin.close();
                    }
                }
                ArrayList axisServiceList = new ArrayList();
                for (int i = 0; i < classList.size(); i++) {
                    String className = (String) classList.get(i);
                    ClassLoader classLoader = Utils.createClassLoader(
                            new URL[]{deploymentFileData.getFile().toURL()},
                            configCtx.getAxisConfiguration().getSystemClassLoader(),
                            true,
                            (File)configCtx.getAxisConfiguration().
                                    getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                    Thread.currentThread().setContextClassLoader(classLoader);
                    className = className.replaceAll(".class", "");
                    className = className.replaceAll("/", ".");
                    JamServiceFactory factory = JamServiceFactory.getInstance();
                    JamServiceParams jam_service_parms = factory.createServiceParams();
                    jam_service_parms.addClassLoader(classLoader);
                    jam_service_parms.includeClass(className);
                    JamService service = factory.createService(jam_service_parms);
                    JamClassIterator jClassIter = service.getClasses();
                    while (jClassIter.hasNext()) {
                        JClass jclass = (JClass) jClassIter.next();
                        if (jclass.getQualifiedName().equals(className)) {
                            /**
                             * Schema genertaion done in two stage 1. Load all the methods and
                             * create type for methods parameters (if the parameters are Bean
                             * then it will create Complex types for those , and if the
                             * parameters are simple type which decribe in SimpleTypeTable
                             * nothing will happen) 2. In the next stage for all the methods
                             * messages and port types will be creteated
                             */
                            JAnnotation annotation =
                                    jclass.getAnnotation(AnnotationConstants.WEB_SERVICE);
                            if (annotation != null) {
                                AxisService axisService;
                                axisService = createAxisService(classLoader,
                                                                className,deploymentFileData.getFile().toURL());
View Full Code Here

            operation = AxisOperationFactory.getAxisOperation(
                    WSDLConstants.MEP_CONSTANT_IN_OUT);
        }
        String opName = jmethod.getSimpleName();
        operation.setName(new QName(opName));
        JAnnotation methodAnnon = jmethod.getAnnotation(AnnotationConstants.WEB_METHOD);
        if (methodAnnon != null) {
            String action = methodAnnon.getValue(AnnotationConstants.ACTION).asString();
            if (action != null && !"".equals(action)) {
                operation.setSoapAction(action);
            }
        }
        return operation;
View Full Code Here

    protected int generateTightMarshal1Body(PrintWriter out) {
        List properties = getProperties();
        int baseSize = 0;
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info->" + property.getGetter().getSimpleName() + "()";

            if (type.equals("boolean")) {
View Full Code Here

    protected void generateTightMarshal2Body(PrintWriter out) {
        List properties = getProperties();
        int count = 0;
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info->" + property.getGetter().getSimpleName() + "()";
            count++;
View Full Code Here

    protected void generateLooseMarshalBody(PrintWriter out) {
        List properties = getProperties();
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info->" + property.getGetter().getSimpleName() + "()";

            if( type.equals( "boolean" ) ) {
View Full Code Here

    protected int generateTightMarshal1Body(PrintWriter out) {
        List properties = getProperties();
        int baseSize = 0;
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty)iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info." + property.getSimpleName();

            if (type.equals("boolean")) {
View Full Code Here

TOP

Related Classes of org.codehaus.jam.JAnnotation

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.