Annotation Type Attribute
-
@Retention(RUNTIME) @Target(TYPE) @Inherited @Repeatable(Container.class) public @interface Attribute
Additional qualifier to be used on element classes which do not use an unique tag name.While custom elements can be uniquely identified using their tag name, e.g.
<vaadin-button>. Flow views and server side composites cannot be identified this way but typically needs an additional filter which can be defined using this annotation.For instance, given
public class MyView extends Divand the corresponding element classpublic class MyViewElement extends DivElementwould match any<div>on the page. To uniquely matchMyViewElement, you could add e.g.setId("myview");in the view and a corresponding@Attribute(name="id", value="myview")forMyViewElement.
-
-
Field Summary
Fields Modifier and Type Fields Description static StringDEFAULT_VALUEstatic StringSIMPLE_CLASS_NAMEReplaced by the simple class name of the element class, with anyElementorPageObjectsuffix removed, and converted to dash-separated-format when used with eithercontains()orvalue(),
-
-
-
Field Detail
-
DEFAULT_VALUE
static final String DEFAULT_VALUE
-
-
-
SIMPLE_CLASS_NAME
static final String SIMPLE_CLASS_NAME
Replaced by the simple class name of the element class, with anyElementorPageObjectsuffix removed, and converted to dash-separated-format when used with eithercontains()orvalue(),
-
-
Element Detail
-
name
String name
The name of the attribute to check.Matches the value of the attribute with the value in
value()or matches a token inside this value withcontains(). If neithervalue()norcontains()is defined, only ensures that the attribute is present.- Returns:
- the name of the attribute to match
-
-
-
value
String value
The value to match with the attribute value.This will match the given value to the full value of the attribute. To match only a token, use
contains().- Returns:
- the value to match with the attribute value
- Default:
- "THE_DEFAULT_VALUE_WHICH_YOU_SURELY_NEVER_EVER_WILL_USE_FOR_REAL, RIGHT?!"
-
-
-
contains
String contains
The value to find within the attribute value.This will match if the given string is one matches one of the space separated tokens the attribute value consists of. To match the whole attribute value, use
value().- Returns:
- the value find inside the attribute value
- Default:
- "THE_DEFAULT_VALUE_WHICH_YOU_SURELY_NEVER_EVER_WILL_USE_FOR_REAL, RIGHT?!"
-
-