public class WebComponentConfigurationRegistry extends Object implements Serializable
For internal use only. May be renamed or removed in a future release.
Modifier | Constructor and Description |
---|---|
protected |
WebComponentConfigurationRegistry()
Protected constructor for internal OSGi extensions.
|
Modifier and Type | Method and Description |
---|---|
Optional<WebComponentConfiguration<? extends Component>> |
getConfiguration(String tag)
Get a web component configuration for given custom element tag if one is
registered.
|
Set<WebComponentConfiguration<? extends Component>> |
getConfigurations()
Get an unmodifiable set containing all registered web component
configurations.
|
<T extends Component> |
getConfigurationsByComponentType(Class<T> componentClass)
Get an unmodifiable set containing all registered web component
configurations for a specific
Component type. |
<T extends Annotation> |
getEmbeddedApplicationAnnotation(Class<T> type)
Returns configuration annotation for embedded application.
|
static WebComponentConfigurationRegistry |
getInstance(VaadinContext context)
Get WebComponentRegistry instance for given servlet context.
|
List<Element> |
getShadowDomElements()
Get a copy of the elements that should be added to the shadow dom hosting
the embedded web component.
|
boolean |
hasConfigurations()
Checks whether the registry contains any web component configurations.
|
boolean |
setConfigurations(Set<WebComponentConfiguration<? extends Component>> configurations)
Registers all available web component configurations to the registry.
|
void |
setShadowDomElements(List<Element> elements)
Set the elements that should be added to each shadow dom hosting an
embedded web component.
|
protected void |
updateRegistry(Set<WebComponentConfiguration<? extends Component>> configurations)
Internal method for updating registry.
|
protected WebComponentConfigurationRegistry()
public Optional<WebComponentConfiguration<? extends Component>> getConfiguration(String tag)
tag
- custom element tagpublic <T extends Component> Set<WebComponentConfiguration<T>> getConfigurationsByComponentType(Class<T> componentClass)
Component
type.T
- componentcomponentClass
- type of the exported Component
WebComponentConfiguration
or an empty set.protected void updateRegistry(Set<WebComponentConfiguration<? extends Component>> configurations)
configurations
- set of web component configurations to registerpublic boolean setConfigurations(Set<WebComponentConfiguration<? extends Component>> configurations)
This can be done only once and any following set should only return false.
configurations
- set of web component configurations to register. These
configurations must have both unique and valid tag names.true
if set successfully or false
if not setpublic boolean hasConfigurations()
true
if setConfigurations(Set)
has been called a
non-empty set.public <T extends Annotation> Optional<T> getEmbeddedApplicationAnnotation(Class<T> type)
WebComponentExporter
classes may declare configuration
annotations. If there are several different annotations declared for
various exporter classes then an exception will be thrown during the
servlet initialization (exporter classes discovering).
type
- the configuration annotation typetype
public Set<WebComponentConfiguration<? extends Component>> getConfigurations()
public void setShadowDomElements(List<Element> elements)
elements
- list of shadow dom elementspublic List<Element> getShadowDomElements()
public static WebComponentConfigurationRegistry getInstance(VaadinContext context)
context
- VaadinService
to keep the instance inCopyright © 2021. All rights reserved.