View Javadoc
1   package org.pojomatic.annotations;
2   
3   import static java.lang.annotation.ElementType.FIELD;
4   import static java.lang.annotation.ElementType.METHOD;
5   import static java.lang.annotation.RetentionPolicy.RUNTIME;
6   
7   import java.lang.annotation.Documented;
8   import java.lang.annotation.Retention;
9   import java.lang.annotation.Target;
10  
11  import org.pojomatic.formatter.PropertyFormatter;
12  
13  /**
14   * Specifies formatting information to be used for creating {@code String} representations of
15   * properties.  Note that using a {@code PropertyFormat} annotation on a property does not influence
16   * whether that property will be included in the {@code toString} implementation.  That is
17   * determined solely by any {@link Property} and {@link AutoProperty} annotations on the POJO.
18   * @see PropertyFormatter
19   */
20  @SuppressWarnings("deprecation")
21  @Target({FIELD, METHOD})
22  @Retention(RUNTIME)
23  @Documented
24  public @interface PropertyFormat {
25  
26    /**
27     * The formatter to use for creating a {@code String} representation.
28     * @return the formatter to use for creating a {@code String} representation.
29     */
30    public Class<? extends PropertyFormatter> value();
31  }