Annotation Type TemplateExtension.TemplateAttribute


  • @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
     }
     
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static String PARAMETER_NAME
      Constant value for value() indicating that the name of the annotated parameter should be used as-is.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String value  
    • Field Detail

      • PARAMETER_NAME

        static final String PARAMETER_NAME
        Constant value for value() indicating that the name of the annotated parameter should be used as-is.