Annotation Interface TemplateExtension.TemplateAttribute

Enclosing class:
TemplateExtension

@Retention(RUNTIME) @Target(PARAMETER) public static @interface TemplateExtension.TemplateAttribute
Used to annotate a template extension method parameter that should be obtained via TemplateInstance.getAttribute(String). The parameter type must be Object.
 @TemplateExtension
 static BigDecimal discountedPrice(Item item, @TemplateAttribute Object locale) {
    // this method matches {item.discountedPrice}
    // ... do some locale-aware formatting
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant value for value() indicating that the name of the annotated parameter should be used as-is.