예제 #1
0
 public JSONAnnotationFinder invoke() {
   JSON json = accessor.getAnnotation(JSON.class);
   serialize = json.serialize();
   if (serialize && json.name().length() > 0) {
     name = json.name();
   }
   return this;
 }
예제 #2
0
  /** Add date to buffer */
  protected void date(Date date, Method method) {
    JSON json = null;
    if (method != null) json = method.getAnnotation(JSON.class);
    if (this.formatter == null) this.formatter = new SimpleDateFormat(JSONUtil.RFC3339_FORMAT);

    DateFormat formatter =
        (json != null) && (json.format().length() > 0)
            ? new SimpleDateFormat(json.format())
            : this.formatter;
    this.string(formatter.format(date));
  }