Annotation Interface StyleBundle.DefaultStyle

Enclosing interface:
StyleBundle

@Retention(RUNTIME) @Target(METHOD) @Documented public static @interface StyleBundle.DefaultStyle
Annotation that provides a default style specification for a method in a StyleBundle interface.

This annotation specifies the style to use if no style is found in the StyleSource for the method. The value should be a valid style specification string as understood by StyleResolver.

Example:

 @StyleBundle.StyleGroup("mygroup")
 interface MyStyles extends StyleBundle {
     @StyleBundle.DefaultStyle("bold,fg:red")
     AttributedString error(String message);

     @StyleBundle.DefaultStyle("fg:blue,underline")
     AttributedString link(String url);
 }
 

If this annotation is not present and no style is found in the style source, a StyleBundleInvocationHandler.StyleBundleMethodMissingDefaultStyleException will be thrown when the method is called.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details