Package com.sun.codemodel

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


    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

    // 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

    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

  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

    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

    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

    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

    // 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

  protected void createVersionVerifyMethod( @Nonnull JDefinedClass testClass, @Nonnull JClass serializerClass, @Nonnull DomainObjectDescriptor domainObjectDescriptor ) {
    JClass domainType = codeGenerator.ref( domainObjectDescriptor.getQualifiedName() );

    JMethod method = testClass.method( JMod.PROTECTED, Void.TYPE, METHOD_NAME_VERIFY_DESERIALIZED )._throws( Exception.class );
    method.annotate( Override.class );
    JVar deserialized = method.param( domainType, PARAM_NAME_DESERIALIZED );
    method.param( Version.class, PARAM_NAME_VERSION );

    JClass assertClass = codeGenerator.ref( CLASS_NAME_ASSERT );
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.