Interface WebComponentConfiguration<C extends Component>
- Type Parameters:
C
- type of the component being exported
- All Superinterfaces:
Serializable
Result of defining an embeddable web component using
WebComponentExporter
. Provides all the necessary information to
generate the web component resources and constructs new
WebComponentBinding
instances with
createWebComponentBinding(com.vaadin.flow.di.Instantiator, com.vaadin.flow.dom.Element, elemental.json.JsonObject)
;- Since:
- 2.0
- Author:
- Vaadin Ltd.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateWebComponentBinding
(Instantiator instantiator, Element element, elemental.json.JsonObject newAttributeDefaults) Creates a newWebComponentBinding
instance.Retrieve the type of the component.Class<? extends WebComponentExporter<C>>
Retrieves the type of theWebComponentExporter
from which this configuration has been generated.Set<PropertyData<? extends Serializable>>
Set of all thePropertyData
objects defining the web component's properties.Class<? extends Serializable>
getPropertyType
(String propertyName) Retrieve the type of a property's value.getTag()
Retrieves the tag name configured by the web component exporter.boolean
hasProperty
(String propertyName) Check if the configuration has a property identified by thepropertyName
.
-
Method Details
-
hasProperty
Check if the configuration has a property identified by thepropertyName
.- Parameters:
propertyName
- name of the property, not null- Returns:
- has property
-
getPropertyType
Retrieve the type of a property's value. If the property is not known, returnsnull
- Parameters:
propertyName
- name of the property, not null- Returns:
- property type or null
-
getComponentClass
Retrieve the type of the component.- Returns:
- component type
-
getPropertyDataSet
Set<PropertyData<? extends Serializable>> getPropertyDataSet()Set of all thePropertyData
objects defining the web component's properties.- Returns:
- set of
PropertyData
-
createWebComponentBinding
WebComponentBinding<C> createWebComponentBinding(Instantiator instantiator, Element element, elemental.json.JsonObject newAttributeDefaults) Creates a newWebComponentBinding
instance.- Parameters:
instantiator
-Instantiator
used to construct instanceselement
- element which acts as the root element for the exportedcomponent
instancenewAttributeDefaults
-JsonObject
containing default overrides set by the user defining the component on a web page. These defaults are set using the web component's attributes.- Returns:
- web component binding which can be used by the web component host to communicate with the component it is hosting
-
getTag
String getTag()Retrieves the tag name configured by the web component exporter.- Returns:
- tag name, not
null
-
getExporterClass
Class<? extends WebComponentExporter<C>> getExporterClass()Retrieves the type of theWebComponentExporter
from which this configuration has been generated.- Returns:
- web component exporter class
-