Interface CockpitComponentDefinitionService

    • Method Detail

      • 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 found
        componentType - 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.
      • 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 definition
        className - class of the component to be created
        context - 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 definition
        className - class of the component to be created
        context - Spring application context from which the dependencies should be wired; if null the dependencies are not wired only the instance is created
        cached - 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