Class ExtensionManager

    • Constructor Detail

      • ExtensionManager

        public ExtensionManager()
    • Method Detail

      • getInstance

        public static ExtensionManager getInstance()
        Returns:
        The service instance.
      • setInstance

        public static void setInstance​(ExtensionManager instance)
        Parameters:
        instance - The service instance.
      • register

        public abstract void register​(Class<?> extensibleType,
                                      ExtensionFactory factory)
        Registers an extension factory for the given extensible type.
        Parameters:
        extensibleType - The extensible type.
        factory - The factory.
      • unregister

        public abstract void unregister​(Class<?> extensibleType,
                                        ExtensionFactory factory)
        Unregisters an extension factory for the given extensible type.
        Parameters:
        extensibleType - The extensible type.
        factory - The factory.
      • getExtensionFactories

        public abstract ExtensionFactory[] getExtensionFactories​(Class<?> extensibleType)
        Gets all extension factories registered for the given type.
        Parameters:
        extensibleType - The extensible type.
        Returns:
        The list of extension factories. May be empty.
      • getExtension

        public <E> E getExtension​(Object extensibleObject,
                                  Class<E> extensionType)
        Gets a dynamic extension for the given (extensible) object.
        Parameters:
        extensibleObject - The (extensible) object.
        extensionType - The type of the requested extension.
        Returns:
        The extension instance, or null if the given object is not extensible by this factory or if the factory fails to provide that extension.
        See Also:
        ExtensionFactory.getExtension(Object, Class)