the type of the Custom Element
Override the default attribute name.
the attribute name
Override the kind of the field.
This API is dedicated for developer of Builders.
Decorates the property of the field.
Decorates the listener method which is invoked each time the field value mutate.
When the property name is not specified (i.e. @FieldBuilder.get()
), then it's discovered from the decorated method name.
The pattern is <prefix><PropertyNameInCamelCase>
, where <prefix>
is by default on
.
the prefix used to discover the property name from the method name
Register a listener which will be invoked when the field value mutate.
A listener is callback function (FieldListener) which have two arguments:
the listener
Provide a fresh builder.
the type of the Custom Element
the property name, it's optional only when the decorator API (i.e. FieldBuilder.decorate or FieldBuilder.decorate) is used
Generated using TypeDoc
The builder binds a property to an attribute. So that, the value is available and mutable from both sides.
Because of the binding with an attribute, the type of the property has to be either a
string
or aboolean
. That means, the kind of the field can be String or Boolean. The default kind of field is String, the switch to Boolean has to be done explicitly with FieldBuilder.boolean.By default, the name of the attribute is the the kebab case (
KebabCase_notation
=>kebab-case-notation
) of the property name. However, the attribute name can be overridden with FieldBuilder.attribute.The listeners of the field values are simple callback functions, c.f. FieldListener. They can be registered with FieldBuilder.listener.
Finally, the builder can be registered using the method ElementBuilder.builder of the main builder (i.e. ElementBuilder). However, it can also be registered with the decorative style using the decorator FieldBuilder.decorate.