Interface WebComponentConfiguration<C extends Component>
-
- Type Parameters:
C
- type of the component being exported
- All Superinterfaces:
Serializable
public interface WebComponentConfiguration<C extends Component> extends Serializable
Result of defining an embeddable web component usingWebComponentExporter
. Provides all the necessary information to generate the web component resources and constructs newWebComponentBinding
instances withcreateWebComponentBinding(com.vaadin.flow.di.Instantiator, com.vaadin.flow.dom.Element, elemental.json.JsonObject)
;- Since:
- 2.0
- Author:
- Vaadin Ltd.
- See Also:
for constructing new instances
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebComponentBinding<C>
createWebComponentBinding(Instantiator instantiator, Element element, elemental.json.JsonObject newAttributeDefaults)
Creates a newWebComponentBinding
instance.Class<C>
getComponentClass()
Retrieve the type of the component.Class<? extends WebComponentExporter<C>>
getExporterClass()
Retrieves the type of theWebComponentExporter
from which this configuration has been generated.Set<PropertyData<? extends Serializable>>
getPropertyDataSet()
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.String
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 Detail
-
hasProperty
boolean hasProperty(String propertyName)
Check if the configuration has a property identified by thepropertyName
.- Parameters:
propertyName
- name of the property, not null- Returns:
- has property
-
getPropertyType
Class<? extends Serializable> getPropertyType(String propertyName)
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
Class<C> 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
-
-