Examples of annotate()


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

        if ( !gen.getUniqueConstraint().isEmpty() )
        {
            final JAnnotationArrayMember uclst = a.paramArray( "uniqueConstraints" );
            for ( UniqueConstraint uc : gen.getUniqueConstraint() )
            {
                final JAnnotationUse uca = uclst.annotate( javax.persistence.UniqueConstraint.class );
                final JAnnotationArrayMember colNames = uca.paramArray( "columnNames" );
                for ( String cn : uc.getColumnName() )
                {
                    colNames.param( cn );
                }
View Full Code Here

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

       
        JDefinedClass servCls = model._class(portName);
        servCls._extends(javax.xml.ws.Service.class);
       
        String wsdlUrl = context.getWsdlLocation();
        JAnnotationUse clientAnn = servCls.annotate(WebServiceClient.class);
        clientAnn.param("targetNamespace", ns);
        clientAnn.param("name", name);
        clientAnn.param("wsdlLocation", wsdlUrl);
       
        JType qnameType = model._ref(QName.class);
View Full Code Here

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

      if (field == null) {
        classOutline.implClass.annotate(Deprecated.class);
        LOG.info("       1YY>>" + string);
      } else {
        final JFieldVar jFieldVar = classOutline.implClass.fields().get(field);
        jFieldVar.annotate(Deprecated.class);
        LOG.info("       1YY>>" + string + "#" + field);
      }
    }
  }
}
View Full Code Here

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

        toStringMethod.body()._return(invoke);
       
        JDocComment doc = toStringMethod.javadoc();
        doc.add("Generates a String representation of the contents of this type.");
        doc.add("\nThis is an extension method, produced by the 'ts' xjc plugin");
        toStringMethod.annotate(Override.class);
    }
}
View Full Code Here

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

    // generate hashCode() and equals()-method
    final JMethod clone = implClass.method(JMod.PUBLIC, implClass, "clone");

    // annotate with @Override
    clone.annotate(Override.class);
    // clone._throws(CloneNotSupportedException.class);

    final JVar copy = clone.body().decl(implClass, "copy");

    if (extends1.fullName().equals("java.lang.Object")) {
View Full Code Here

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

    booleanConverter._extends(xmladapter);
   
    // toString
    final JMethod unmarshal = booleanConverter.method(JMod.PUBLIC, Boolean.class, "unmarshal");
    final JVar stringConstructorArg = unmarshal.param(JMod.FINAL, Integer.class, "i");
    unmarshal.annotate(Override.class);
    unmarshal._throws(Exception.class);
    unmarshal.body()._return(JOp.cond(stringConstructorArg.eq(JExpr._null()), JExpr._null(), stringConstructorArg.eq(JExpr.lit(1))));
   
    // toString
    final JMethod marshal = booleanConverter.method(JMod.PUBLIC, Integer.class, "marshal");
View Full Code Here

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

    unmarshal.body()._return(JOp.cond(stringConstructorArg.eq(JExpr._null()), JExpr._null(), stringConstructorArg.eq(JExpr.lit(1))));
   
    // toString
    final JMethod marshal = booleanConverter.method(JMod.PUBLIC, Integer.class, "marshal");
    final JVar unmarshallparam = marshal.param(JMod.FINAL, Boolean.class, "b");
    marshal.annotate(Override.class);
    marshal._throws(Exception.class);
    marshal.body()._return(JOp.cond(unmarshallparam.eq(JExpr._null()), JExpr._null(), JOp.cond(unmarshallparam, JExpr.lit(1), JExpr.lit(0))));

  }
View Full Code Here

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

    // longitude = coordinateClass.field(JMod.PRIVATE, cm.DOUBLE, "longitu33de", JExpr.lit(0.0d));
    // latitude = coordinateClass.field(JMod.PRIVATE, cm.DOUBLE, "latitud33e", JExpr.lit(0.0d));
    // altitude = coordinateClass.field(JMod.PRIVATE, cm.DOUBLE, "altitud33e", JExpr.lit(0.0d));

    final JMethod noArgConstructor = coordinateClass.constructor(JMod.PRIVATE);
    noArgConstructor.annotate(Deprecated.class);
    noArgConstructor.javadoc().add("Default no-arg constructor is private. Use overloaded constructor instead! ");
    noArgConstructor.javadoc().add("(Temporary solution, till a better and more suitable ObjectFactory is created.) ");

    final JMethod twoDoubleArgConstructor = coordinateClass.constructor(JMod.PUBLIC);
    addConstructorParam(twoDoubleArgConstructor, longitude);
View Full Code Here

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

    stringArgConstructor.body()._if(JExpr.ref(varCoords.name()).ref("length").eq(JExpr.lit(3)))._then().assign(
        JExpr.refthis(altitude.name()), JExpr.ref("Double").invoke("parseDouble").arg(JExpr.direct("coords[2]")));

    // toString
    final JMethod toString = coordinateClass.method(JMod.PUBLIC, stringClass, "toString");
    toString.annotate(Override.class);
    final JVar sbVar = toString.body().decl(stringBuilderClass, "sb", JExpr._new(stringBuilderClass));
    toString.body().add(sbVar.invoke("append").arg(longitude));
    toString.body().add(sbVar.invoke("append").arg(","));
    toString.body().add(sbVar.invoke("append").arg(latitude));
    toString.body()._if(JExpr.ref(altitude.name()).ne(JExpr.lit(0.0)))._then().add(sbVar.invoke("append").arg(",")).add(
View Full Code Here

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

    // toString
    final JMethod marshall = coordinateClassConverter.method(JMod.PUBLIC, String.class, "marshal");
    final JVar stringConstructorArg = marshall.param(JMod.FINAL, listGenericsCoordinates, "dt");
    marshall._throws(Exception.class);
    marshall.annotate(Override.class);
    final JVar sbVarMarshall = marshall.body().decl(stringBuilderClass, "sb", JExpr._new(stringBuilderClass));
    final JForEach forMarshall = marshall.body().forEach(coordinateClass, "coord", stringConstructorArg);
    // forMarshall.body().add(sbVarMarshall.invoke("append").arg(forMarshall.var().name() + " + \" \""));
    forMarshall.body().add(sbVarMarshall.invoke("append").arg(JExpr.direct("coord + \" \"")));
    marshall.body()._return(sbVarMarshall.invoke("toString").invoke("trim"));
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.