@Target(value=TYPE) public @interface CustomLabel
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.
Leads to:@CustomLabel class MyObject { @LabelPart String attribute1 String attribute2 }
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( ); } }
LabelPart
Modifier and Type | Optional Element and Description |
---|---|
boolean |
singleLine
Defines if the label should be printed to a single line.
|
Copyright © 2018–2021 b+m Informatik AG. All rights reserved.