@Inherited @Documented @Target(value={FIELD,METHOD,PARAMETER}) @Retention(value=RUNTIME) public @interface DataField
Templated
Composite
component corresponds to an HTML element in the class's companion template.
This annotation can only be used in subclasses of Composite
that have been annotated with Templated
,
or in super-classes of such Composite
types.
The matching of Java references to HTML elements is performed as follows:
@DataField
annotation has a value()
argument, it is used as the reference name. For fields, the default name is the field name. Method and constructor
parameters have no default name, so they must always specify a value.
<div class="eat drink be-merry">matches Java references named eat, drink, or be-merry.
If more than one Java reference matches the same HTML element in the template, it is an error. For example, given a template containing the element <div class="eat drink be-merry">, the following Java code is in error:
public abstract String value
data-field
in the corresponding HTML template, which the annotated element
represents.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.