Examples of annotate()


Examples of com.sun.codemodel.JMethod.annotate()

    final JMethod generateWith = cc.implClass.method(JMod.PUBLIC, cc.implClass, "with" + Util.upperFirst(field.name()));
    final JVar value = generateWith.param(JMod.FINAL, Util.removeJAXBElement(cm, field.type()), field.name());
    // set the assignment to the body: this.value = value;
    if (override) {
      if (annotateObvicious != null) {
        generateWith.annotate(annotateObvicious);
      }
      generateWith.annotate(Override.class);
      // super.setObjectSimpleExtensionGroup(objectSimpleExtensionGroup);
      // generateSet.body().assign(JExpr._this().ref(field.name()), value);
      generateWith.body().directStatement("super.with" + Util.upperFirst(field.name()) + "(" + field.name() + ");");
View Full Code Here

Examples of com.sun.codemodel.JMethod.annotate()

    // set the assignment to the body: this.value = value;
    if (override) {
      if (annotateObvicious != null) {
        generateWith.annotate(annotateObvicious);
      }
      generateWith.annotate(Override.class);
      // super.setObjectSimpleExtensionGroup(objectSimpleExtensionGroup);
      // generateSet.body().assign(JExpr._this().ref(field.name()), value);
      generateWith.body().directStatement("super.with" + Util.upperFirst(field.name()) + "(" + field.name() + ");");
    } else {
      generateWith.javadoc().add("fluent setter");
View Full Code Here

Examples of com.sun.codemodel.JVar.annotate()

    unmarshalFromKMZ.javadoc().add("KMZ to Java\n");
    unmarshalFromKMZ.javadoc().add("Similar to the other unmarshal methods\n\n");
    unmarshalFromKMZ.javadoc().add("with the exception that it transforms a KMZ-file into a graph of Java objects. \n")
    unmarshalFromKMZ._throws(IOException.class);
    final JVar varFile = unmarshalFromKMZ.param(fileClass, "file");
    varFile.annotate(NotNull.class);
    final JVar varEMPTY_KML_ARRAY = unmarshalFromKMZ.body().decl(kmlClass.array(), "EMPTY_KML_ARRAY", JExpr.direct("new Kml[0]"));// JExpr._new(kmlClass.array().)..arg("0"));
    unmarshalFromKMZ.body()._if(varFile.invoke("getName").invoke("endsWith").arg(".kmz").not())._then()._return(varEMPTY_KML_ARRAY);
    final JVar varZip = unmarshalFromKMZ.body().decl(zipFileClass, "zip",JExpr._new(zipFileClass).arg(varFile) );
    final JVar varEntries = unmarshalFromKMZ.body().decl(enumerationClass.boxify().narrow(zipEntryClass.boxify().wildcard()), "entries", varZip.invoke("entries"));
    unmarshalFromKMZ.body()._if(varFile.invoke("exists").not())._then()._return(varEMPTY_KML_ARRAY);
View Full Code Here

Examples of com.sun.codemodel.JVar.annotate()

    // missingNameCounter = 1;
    // return false;
    // }
    final JMethod generateMarshalKmz = cc.implClass.method(JMod.PUBLIC, cc.implClass.owner().BOOLEAN, "marshalAsKmz");
    final JVar varName = generateMarshalKmz.param(stringClass, "name");
    varName.annotate(NotNull.class);
    final JVar varAdditionalFiles = generateMarshalKmz.varParam(kmlClass.boxify(), "additionalFiles");
    generateMarshalKmz._throws(IOException.class);
    final JVar varOut = generateMarshalKmz.body().decl(zipOutputStreamClass, "out", JExpr._new(zipOutputStreamClass).arg(JExpr._new(fileOutputStreamClass).arg(varName)));
    generateMarshalKmz.body().add(varOut.invoke("setComment").arg("KMZ-file created with Java API for KML. Visit us: http://code.google.com/p/javaapiforkml/"));
    generateMarshalKmz.body().add(JExpr._this().invoke(createAddToKmzFile).arg(JExpr._this()).arg(varOut).arg(JExpr.TRUE));
View Full Code Here

Examples of com.sun.codemodel.internal.JAnnotationArrayMember.annotate()

                    actionAnn = jMethod.annotate(Action.class);
                }
                if (jam == null) {
                    jam = actionAnn.paramArray("fault");
                }
                final JAnnotationUse faAnn = jam.annotate(FaultAction.class);
                faAnn.param("className", map.get(f.getName()));
                faAnn.param("value", f.getAction());
            }
        }
    }
View Full Code Here

Examples of com.sun.codemodel.internal.JDefinedClass.annotate()

        }

        cls._extends(java.lang.Exception.class);

        //@WebFault
        JAnnotationUse faultAnn = cls.annotate(WebFault.class);
        faultAnn.param("name", fault.getBlock().getName().getLocalPart());
        faultAnn.param("targetNamespace", fault.getBlock().getName().getNamespaceURI());

        JType faultBean = fault.getBlock().getType().getJavaType().getType().getType();
View Full Code Here

Examples of com.sun.codemodel.internal.JMethod.annotate()

        if(ei.getDefaultValue()!=null)
            xemw.defaultValue(ei.getDefaultValue());

        if(ei.getProperty().inlineBinaryData())
            m.annotate(XmlInlineBinaryData.class);

                    // if the element is adapter, put that annotation on the factory method
        outline.generateAdapterIfNecessary(ei.getProperty(),m);
    }
View Full Code Here

Examples of com.sun.codemodel.internal.JVar.annotate()

        for( ClassOutline ci : outline.getClasses() ) {
            JDefinedClass impl = ci.implClass;
            if (ci.getSuperClass() == null) {
                JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName);
                $loc.annotate(XmlLocation.class);
                $loc.annotate(XmlTransient.class);

                impl._implements(Locatable.class);

                impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc);
View Full Code Here

Examples of com.sun.jdo.api.persistence.enhancer.impl.ClassControl.annotate()

            }

            // Then perform the annotation actions
            for (Iterator e = classes.iterator(); e.hasNext();) {
                ClassControl cc = (ClassControl)e.next();
                cc.annotate();

                if (false) {
                    dumpClass(cc);
                }
            }
View Full Code Here

Examples of com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation.annotate()

                m = cls.method(JMod.PUBLIC, void.class, method.getName());
                methodDoc = m.javadoc();
            }else {
                JAXBTypeAndAnnotation retType = method.getReturnType().getType();
                m = cls.method(JMod.PUBLIC, retType.getType(), method.getName());
                retType.annotate(m);
                methodDoc = m.javadoc();
                JCommentPart ret = methodDoc.addReturn();
                ret.add("returns "+retType.getName());
            }
            if(methodJavaDoc != null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.