Package org.codehaus.jam

Examples of org.codehaus.jam.JAnnotation


        }
    }

    public String getOpenWireOpCode(JClass element) {
      if (element != null) {
      JAnnotation annotation = element.getAnnotation("openwire:marshaller");
      return stringValue(annotation, "code", "0");
    }
    return "0";
    }
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 void generateTightUnmarshalBody(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 propertyTypeName = propertyType.getSimpleName();

      if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
        generateTightUnmarshalBodyForArrayProperty(out, property, size);
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();
    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 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 void generateLooseUnmarshalBody(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 propertyTypeName = propertyType.getSimpleName();

      if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
        generateLooseUnmarshalBodyForArrayProperty(out, property, size);
View Full Code Here

                properties.add(p);
            }
        }
        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 name = toPropertyCase(property.getSimpleName());
            boolean cached = isCachedProperty(property);

            String type = property.getType().getQualifiedName();
            if (type.equals("boolean")) {
View Full Code Here

  // Public methods

  public void addAnnotationClasses(JClass[] classes) {
    for(int i=0; i<classes.length; i++) {
      if (classes[i].isAnnotationType()) {
        JAnnotation ann = classes[i].getAnnotation(mTiger.getAnnogenInfoClass());
        if (ann == null) {
          warn("Ignoring "+classes[i].getQualifiedName()+
               " because it does not declare an @AnnogenInfo annotation.");
          continue; //REVIEW should this be an error instead?
        }
        JAnnotationValue val = ann.getValue(ANNOGENINFO_ANNOBEAN_CLASSNAME);
        if (val == null) {  //should not happen - it's not an optional value
          warn("Ignoring "+classes[i].getQualifiedName()+
               " because its @AnnogenInfo annotation does specify an "+
               ANNOGENINFO_ANNOBEAN_CLASSNAME);
          continue; //REVIEW should this be an error instead?
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.