Package com.hybris.cockpitng.core
Interface CockpitComponentDefinitionService
-
- All Known Implementing Classes:
CockpitModuleComponentDefinitionService,DefaultCockpitComponentDefinitionService
public interface CockpitComponentDefinitionServiceThis service is responsible for loading widget definitions and providing them in form ofWidgetDefinitionobjects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidclearDefinitions()Clears components definitions.<T> TcreateAutowiredComponent(AbstractCockpitComponentDefinition definition, java.lang.String className, org.springframework.context.ApplicationContext context)Creates autowired component<T> TcreateAutowiredComponent(AbstractCockpitComponentDefinition definition, java.lang.String className, org.springframework.context.ApplicationContext context, boolean cached)Creates autowired componentjava.util.List<AbstractCockpitComponentDefinition>getAllComponentDefinitions()Provides all component definitions available in the system.org.springframework.context.ApplicationContextgetApplicationContext(AbstractCockpitComponentDefinition definition)Deprecated, for removal: This API element is subject to removal in a future version.since 1808, useApplicationContextAwareinsteadjava.lang.ClassLoadergetClassLoader(AbstractCockpitComponentDefinition definition)Deprecated, for removal: This API element is subject to removal in a future version.since 1808, useCockpitApplicationContext.getClassLoader()insteadAbstractCockpitComponentDefinitiongetComponentDefinitionForCode(java.lang.String code)Looks for a component definition with the given Editor code (example: 'com.hybris.cockpitng.editor.defaulttext')<T extends AbstractCockpitComponentDefinition>
TgetComponentDefinitionForCode(java.lang.String code, java.lang.Class<T> componentType)Looks for a component definition with the given code.<T extends AbstractCockpitComponentDefinition>
java.util.List<T>getComponentDefinitionsByClass(java.lang.Class<T> componentType)Provides all component definitions of given type.default java.util.Collection<AbstractCockpitComponentDefinition>getExtensionsDefinitions()Get components definitions for extensions.java.util.Map<java.lang.String,WidgetDefinition>getStubWidgetDefinitions()Returns all stub widget definitions that were registered for 'non-widget' aware componentsvoidreloadDefinitions()Reloads all component definitions.
-
-
-
Method Detail
-
getClassLoader
@Deprecated(since="1808", forRemoval=true) java.lang.ClassLoader getClassLoader(AbstractCockpitComponentDefinition definition)Deprecated, for removal: This API element is subject to removal in a future version.since 1808, useCockpitApplicationContext.getClassLoader()instead
-
getApplicationContext
@Deprecated(since="1808", forRemoval=true) org.springframework.context.ApplicationContext getApplicationContext(AbstractCockpitComponentDefinition definition)Deprecated, for removal: This API element is subject to removal in a future version.since 1808, useApplicationContextAwareinstead
-
getAllComponentDefinitions
java.util.List<AbstractCockpitComponentDefinition> getAllComponentDefinitions()
Provides all component definitions available in the system.- Returns:
- all component definitions available in the system
-
getComponentDefinitionsByClass
<T extends AbstractCockpitComponentDefinition> java.util.List<T> getComponentDefinitionsByClass(java.lang.Class<T> componentType)
Provides all component definitions of given type.- Parameters:
componentType- class of component- Returns:
- all component definitions available in the system
-
getComponentDefinitionForCode
AbstractCockpitComponentDefinition getComponentDefinitionForCode(java.lang.String code)
Looks for a component definition with the given Editor code (example: 'com.hybris.cockpitng.editor.defaulttext')- Parameters:
code- the code of the component definition to be found- Returns:
- the component definition with the given code
- Throws:
java.lang.IllegalArgumentException- if component definition with the given code does not exist
-
getComponentDefinitionForCode
<T extends AbstractCockpitComponentDefinition> T getComponentDefinitionForCode(java.lang.String code, java.lang.Class<T> componentType)
Looks for a component definition with the given code.- Parameters:
code- the code of the component definition to be foundcomponentType- the expected class of the definition- Returns:
- the component definition with the given code
- Throws:
java.lang.IllegalArgumentException- if component definition with the given code does not exist or is not instance of expected componentType
-
clearDefinitions
default void clearDefinitions()
Clears components definitions.
-
getExtensionsDefinitions
default java.util.Collection<AbstractCockpitComponentDefinition> getExtensionsDefinitions()
Get components definitions for extensions.
-
reloadDefinitions
void reloadDefinitions()
Reloads all component definitions.
-
getStubWidgetDefinitions
java.util.Map<java.lang.String,WidgetDefinition> getStubWidgetDefinitions()
Returns all stub widget definitions that were registered for 'non-widget' aware components- Returns:
- all stub widget definitions
-
createAutowiredComponent
<T> T createAutowiredComponent(AbstractCockpitComponentDefinition definition, java.lang.String className, org.springframework.context.ApplicationContext context) throws java.lang.ReflectiveOperationException
Creates autowired component- Type Parameters:
T- type of created component- Parameters:
definition- component definitionclassName- class of the component to be createdcontext- Spring application context from which the dependencies should be wired; if null the dependencies are not wired only the instance is created- Returns:
- component with wired dependencies
- Throws:
java.lang.ReflectiveOperationException- when it is impossible to create instance of class of given name
-
createAutowiredComponent
<T> T createAutowiredComponent(AbstractCockpitComponentDefinition definition, java.lang.String className, org.springframework.context.ApplicationContext context, boolean cached) throws java.lang.ReflectiveOperationException
Creates autowired component- Type Parameters:
T- type of created component- Parameters:
definition- component definitionclassName- class of the component to be createdcontext- Spring application context from which the dependencies should be wired; if null the dependencies are not wired only the instance is createdcached- if true the created object will be cached; for stateful objects the parameter should be false- Returns:
- component with wired dependencies
- Throws:
java.lang.ReflectiveOperationException- when it is impossible to create instance of class of given name
-
-