Annotation Interface Attribute
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 Div
and the
corresponding element class
public class MyViewElement extends DivElement
would match any
<div>
on the page. To uniquely match
MyViewElement
, you could add e.g.setId("myview");
in the view and a corresponding
@Attribute(name="id", value="myview")
for
MyViewElement
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Internal annotation to enable use of multipleAttribute
annotations. -
Required Element Summary
-
Optional Element Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
Replaced by the simple class name of the element class, with anyElement
orPageObject
suffix removed, and converted to dash-separated-format when used with eithercontains()
orvalue()
,
-
Field Details
-
DEFAULT_VALUE
- See Also:
-
SIMPLE_CLASS_NAME
Replaced by the simple class name of the element class, with anyElement
orPageObject
suffix removed, and converted to dash-separated-format when used with eithercontains()
orvalue()
,- See Also:
-
-
Element Details
-
name
String nameThe 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 valueThe 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 containsThe 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?!"
-