Annotation Type CustomLabel


  • @Target(TYPE)
    public @interface CustomLabel
    Classes annotated by CustomLabel automatically implement CustomLabeled. CustomLabeled.getCustomLabel() is implemented by traversing the fields which are annotated by LabelPart. If no field is annotated by LabelPart all the fields are considered while building the custom label. The generation of a getCustomLabel() is omitted if the method is already defined explicitly.
    Usage example:
     @CustomLabel
     class MyObject {
     
       @LabelPart
       String attribute1
       String attribute2
     }
     
    Leads to:
     public class MyObject implements CustomLabeled {
     
         @LabelPart
         private String attribute1;
     
         private String attribute2;
    @Override public String getCustomLabel( ) { final CustomLabelStringBuilder b = new CustomLabelStringBuilder( this ); b.add( "attribute1", this.attribute1 ); return b.toString( ); } }
    Since:
    2.0.0
    Author:
    Oliver Libutzki <[email protected]>
    See Also:
    LabelPart
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean singleLine
      Defines if the label should be printed to a single line.
    • Element Detail

      • singleLine

        boolean singleLine
        Defines if the label should be printed to a single line.
        Returns:
        single line result
        Since:
        2.0.0
        Default:
        false