Examples of annotate()


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

    // toString
    final JMethod unmarshall = coordinateClassConverter.method(JMod.PUBLIC, listGenericsCoordinates, "unmarshal");
    final JVar unmarshallparam = unmarshall.param(JMod.FINAL, String.class, "s");
    unmarshall._throws(Exception.class);
    unmarshall.annotate(Override.class);

    //    http://code.google.com/p/javaapiforkml/issues/detail?id=10
    //    changed:
    //      String[] coords = s.replaceAll(",[ ]+?", ",").trim().split(" ");
    //      to:
View Full Code Here

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

 
  private void createNoArgConstructor(final ClassOutline classOutline, final int mods) {
    // Create the default, no-arg constructor
    final JMethod defaultConstructor = classOutline.implClass.constructor(mods);
    if (mods == JMod.PRIVATE) {
    defaultConstructor.annotate(Deprecated.class);
    }
    defaultConstructor.javadoc().add("Default no-arg constructor is private. Use overloaded constructor instead! ");
    defaultConstructor.javadoc().add("(Temporary solution, till a better and more suitable ObjectFactory is created.) ");
    defaultConstructor.body().invoke("super");
  }
View Full Code Here

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

  private void createNoArgConstructor(final ClassOutline classOutline, final int mods) {
    // Create the default, no-arg constructor
    final JMethod defaultConstructor = classOutline.implClass.constructor(mods);
    if (mods == JMod.PRIVATE) {
      defaultConstructor.annotate(Deprecated.class);
      defaultConstructor.javadoc().add("Default no-arg constructor is private. Use overloaded constructor instead! ");
      defaultConstructor.javadoc().add("(Temporary solution, till a better and more suitable ObjectFactory is created.) ");
    }
    defaultConstructor.body().invoke("super");
  }
View Full Code Here

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

    boolean isSuperClass = false;
    if (classOutline != null) {
      isSuperClass = checkForSuperClass((ClassOutlineImpl) classOutline);
    }
    // annotate with @Override
    toString.annotate(Override.class);

    for (final JFieldVar jFieldVar : fields) {
      LOG.info("!!!!!!!!!!!!!!!!!!!!! " + jFieldVar.name());
    }
View Full Code Here

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

    final JMethod generateSet = cc.implClass.method(JMod.PUBLIC, cc.implClass.owner().VOID, "set" + Util.upperFirst(field.name()));
    final JVar value = generateSet.param(JMod.FINAL, field.type(), field.name());
    // set the assignment to the body: this.value = value;
    if (override) {
      if (annotateObvicious != null) {
        generateSet.annotate(annotateObvicious);
      }
      generateSet.annotate(Override.class);
      // super.setObjectSimpleExtensionGroup(objectSimpleExtensionGroup);
      // generateSet.body().assign(JExpr._this().ref(field.name()), value);
      generateSet.body().directStatement("super.set" + Util.upperFirst(field.name()) + "(" + value.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) {
        generateSet.annotate(annotateObvicious);
      }
      generateSet.annotate(Override.class);
      // super.setObjectSimpleExtensionGroup(objectSimpleExtensionGroup);
      // generateSet.body().assign(JExpr._this().ref(field.name()), value);
      generateSet.body().directStatement("super.set" + Util.upperFirst(field.name()) + "(" + value.name() + ");");
    } else {
      generateSet.javadoc().append("Sets the value of the " + field.name() + " property");
View Full Code Here

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

    if (classOutline != null) {
      isSuperClass = checkForSuperClass((ClassOutlineImpl)classOutline);
    }
    // annotate with @Override
    hashCodeMethod.annotate(Override.class);
    equalsMethod.annotate(Override.class);

    // add paramter for equals()-method
    final JVar vObj = equalsMethod.param(Object.class, "obj");

    // is it me? this==obj -> true
View Full Code Here

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

  private JDefinedClass createNestedPrefixCustomizer(final ClassOutlineImpl cc) throws JClassAlreadyExistsException {
    final JDefinedClass namespacebeautyfier = cc.implClass._class(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, "NameSpaceBeautyfier");
    namespacebeautyfier._extends(NamespacePrefixMapper.class);

    final JMethod namespacebeautyfiergetpreferredprefix = namespacebeautyfier.method(JMod.PUBLIC, stringClass, "getPreferredPrefix");
    namespacebeautyfiergetpreferredprefix.annotate(Override.class);
    namespacebeautyfiergetpreferredprefix.javadoc().append("Internal method!\n");
    namespacebeautyfiergetpreferredprefix.javadoc().append(
        "<p>Customizing Namespace Prefixes During Marshalling to a more readable format.</p>\n");
    namespacebeautyfiergetpreferredprefix.javadoc().append("<p>The default output is like:</p>\n");
    namespacebeautyfiergetpreferredprefix
View Full Code Here

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

    final JMethod generateAdd = cc.implClass.method(JMod.PUBLIC, cc.implClass, "addTo" + Util.upperFirst(field.name()));
    final JVar value = generateAdd.param(JMod.FINAL, type, field.name());

    if (override) {
      if (annotateObvicious != null) {
        generateAdd.annotate(annotateObvicious);
      }
      generateAdd.annotate(Override.class);
      // if (field.name().equals("coordinates")) {
      // LOG.info("####################### coordinates found : create new #######################");
      // generateAdd.body().add(JExpr._super().invoke("get" +
View Full Code Here

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

    if (override) {
      if (annotateObvicious != null) {
        generateAdd.annotate(annotateObvicious);
      }
      generateAdd.annotate(Override.class);
      // if (field.name().equals("coordinates")) {
      // LOG.info("####################### coordinates found : create new #######################");
      // generateAdd.body().add(JExpr._super().invoke("get" +
      // Util.upperFirst(field.name())).invoke("add").arg(JExpr._new(annotateCoordinates).arg(value)));
      // } else {
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.