Package org.codehaus.jam

Examples of org.codehaus.jam.JAnnotation


        for (Iterator<JProperty> iter = properties.iterator(); iter.hasNext();) {
            JProperty property = 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<JProperty> iter = properties.iterator(); iter.hasNext();) {
            JProperty property = 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<JProperty> iter = properties.iterator(); iter.hasNext();) {
            JProperty property = 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 generateMarshal1Body(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() + "()";

            out.print(indent);
View Full Code Here

    protected void generateMarshal2Body(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() + "()";

            out.print(indent);
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

  /**
   * Returns the first annotation with the given name that is found on
   * this property's getter and/or setters.
   */
  public JAnnotation getAnnotation(String named) {
    JAnnotation out = (mGetter != null) ? mGetter.getAnnotation(named) : null;
    if (out != null) return out;
    return (mSetter != null) ? mSetter.getAnnotation(named) : null;
  }
View Full Code Here

    if (mName2Annotation == null) return null;
    valueId = valueId.trim();

    int delim = valueId.indexOf('@');
    if (delim == -1 || delim == valueId.length()-1) {
      JAnnotation ann = getAnnotation(valueId);
      if (ann == null) return null;
      return ann.getValue(JAnnotation.SINGLE_VALUE_NAME);
    } else {
      JAnnotation ann = getAnnotation(valueId.substring(0,delim));
      if (ann == null) return null;

      return ann.getValue(valueId.substring(delim+1));
    }
  }
View Full Code Here

        for (Iterator<JProperty> iter = properties.iterator(); iter.hasNext();) {
            JProperty property = 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<JProperty> iter = properties.iterator(); iter.hasNext();) {
            JProperty property = 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<JProperty> iter = properties.iterator(); iter.hasNext();) {
            JProperty property = 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

                 * then it will create Complex types foer 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);
                JComment comment = jclass.getComment();
                if (comment !=null) {
                    System.out.println(comment.getText());
                }
                if (annotation != null) {
                    String tns =
                            annotation.getValue(AnnotationConstants.TARGETNAMESPACE).asString();
                    if (tns != null && !"".equals(tns)) {
                        targetNamespace = tns;
                        schemaTargetNameSpace = tns;
                    }
                        service.setName(Utils.getAnnotatedServiceName(serviceClass,annotation));
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.