@Override
 public Void visitType(TypeMirror t, JAnnotationArrayMember p) {
   JClass annotationClass = helper.typeMirrorToJClass(t, holder);
   JExpression dotclass = JExpr.dotclass(annotationClass);
   p.param(dotclass);
   return null;
 }
 @Override
 public Void visitEnumConstant(VariableElement c, JAnnotationArrayMember p) {
   JClass annotationClass = helper.typeMirrorToJClass(c.asType(), holder);
   JExpression expression = JExpr.direct(annotationClass.fullName() + "." + c.getSimpleName());
   p.param(expression);
   return null;
 }
  @Override
  public void propertyOrder(JDefinedClass clazz, JsonNode propertiesNode) {
    JAnnotationArrayMember annotationValue =
        clazz.annotate(JsonPropertyOrder.class).paramArray("value");

    for (Iterator<String> properties = propertiesNode.fieldNames(); properties.hasNext(); ) {
      annotationValue.param(properties.next());
    }
  }
Exemplo n.º 4
0
  private void addProducesAnnotation(
      final Collection<MimeType> uniqueResponseMimeTypes, final JMethod method) {
    if (uniqueResponseMimeTypes.isEmpty()) {
      return;
    }

    final JAnnotationArrayMember paramArray =
        method.annotate(Produces.class).paramArray(DEFAULT_ANNOTATION_PARAMETER);

    for (final MimeType responseMimeType : uniqueResponseMimeTypes) {
      paramArray.param(responseMimeType.getType());
    }
  }
 @Override
 public Void visitString(String s, JAnnotationArrayMember p) {
   p.param(s);
   return null;
 }
 @Override
 public Void visitShort(short s, JAnnotationArrayMember p) {
   p.param(s);
   return null;
 }
 @Override
 public Void visitLong(long i, JAnnotationArrayMember p) {
   p.param(i);
   return null;
 }
 @Override
 public Void visitInt(int i, JAnnotationArrayMember p) {
   p.param(i);
   return null;
 }
 @Override
 public Void visitFloat(float f, JAnnotationArrayMember p) {
   p.param(f);
   return null;
 }
 @Override
 public Void visitDouble(double d, JAnnotationArrayMember p) {
   p.param(d);
   return null;
 }
 @Override
 public Void visitChar(char c, JAnnotationArrayMember p) {
   p.param(c);
   return null;
 }
 @Override
 public Void visitByte(byte b, JAnnotationArrayMember p) {
   p.param(b);
   return null;
 }
 @Override
 public Void visitBoolean(boolean b, JAnnotationArrayMember p) {
   p.param(b);
   return null;
 }