Interface WebComponentExporterFactory<C extends Component>
-
- Type Parameters:
C- type of the component to export
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
WebComponentExporterFactory.DefaultWebComponentExporterFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface WebComponentExporterFactory<C extends Component> extends Serializable
Exports aComponentas a web component.By extending this class you can export a server side
Componentwith a given tag name so that it can be included in any web page as<tag-name>. You can add properties/attributes to the element, which are synchronized with the server and you can fire events from the server, which are available as custom events in the browser.The tag name (must contain at least one dash and be unique on the target web page) is provided through the super constructor. Note that the exporter tag is not related to the tag used by the
Componentbeing exported and they cannot be the same.The component class to exported is determined by the parameter given to
WebComponentExporterFactorywhen extending it, e.g.extends WebComponentExporterFactory<MyComponent>.You may implement factory instead of direct public implementation of
WebComponentExporterclass in case when it's not convenient or not possible to extend an abstract class (e.g. your class already extends another class).NOTE: the implementation class of the object returned by the
create()method should not be eligible asWebComponentExporter. Otherwise two instances of the same type will be created which makes a collision. So the implementation class should not be either public or should not have a default no-arguments constructor.- Author:
- Vaadin Ltd
- See Also:
WebComponentExporter
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classWebComponentExporterFactory.DefaultWebComponentExporterFactory<C extends Component>Default factory implementation which uses an exporter class to instantiate it using its default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebComponentExporter<C>create()Creates a newWebComponentExporterinstance and configures the tag name of the web component created based on this exporter.
-
-
-
Method Detail
-
create
WebComponentExporter<C> create()
Creates a newWebComponentExporterinstance and configures the tag name of the web component created based on this exporter.- Returns:
- an exporter instance
- See Also:
WebComponentExporter(String)
-
-