Class CentralWrapperRegistry

  • All Implemented Interfaces:
    WrapperRegistry

    public final class CentralWrapperRegistry
    extends Object
    implements WrapperRegistry
    This class is the single access point to the wrapper registry. It uses the two existing registries, whose merge is problematic: the nl.gx.webmanager.foundation.WrapperRegistry cannot be put into the nl.gx.webmanager.services.wrapper.WrapperRegistry because that would reveal SiteWorks internals in the service API. The reverse is also not nice, because access to mappings.xml and override_mappings.xml is a bit problematic. The requests are delegated to the two registries: first to the service registry, and if this was unsuccesfull, then to the API registry.
    Author:
    martijnh
    • Method Detail

      • getByContentType

        public WrapperDefinition getByContentType​(String arg0)
        Description copied from interface: WrapperRegistry
        Returns null or a WrapperDefinition identified by its content type.
        Specified by:
        getByContentType in interface WrapperRegistry
        Parameters:
        arg0 - Name of the content type
        Returns:
        null or a WrapperDefinition identified by its content type
      • getByImplementation

        public WrapperDefinition getByImplementation​(String arg0)
        Description copied from interface: WrapperRegistry
        Returns null or a WrapperDefinition identified by its fully qualified classname.
        Specified by:
        getByImplementation in interface WrapperRegistry
        Parameters:
        arg0 - Fully qualified classname
        Returns:
        null or a WrapperDefinition identified by its fully qualified classname
      • getByInterface

        public WrapperDefinition getByInterface​(String arg0)
        Description copied from interface: WrapperRegistry
        Returns null or a WrapperDefinition identified by its fully qualified classname.
        Specified by:
        getByInterface in interface WrapperRegistry
        Parameters:
        arg0 - Fully qualified classname
        Returns:
        null or a WrapperDefinition identified by its fully qualified classname
      • getComponentByInterface

        public Component getComponentByInterface​(String fullyQualifiedClassName)
        Returns the component that provides an implementation for the given full classname of the interface.
        Specified by:
        getComponentByInterface in interface WrapperRegistry
        Parameters:
        fullyQualifiedClassName -
        Returns:
        The component that provides an implementation for the specified interface
      • getByNodeType

        public WrapperDefinition getByNodeType​(String arg0)
        Finds a WrapperDefinition for a given node type name. Note that this method only checks the component registry as (override)mappings.xml do not contain nodetypes.
        Specified by:
        getByNodeType in interface WrapperRegistry
        Parameters:
        arg0 - the name of the nodetype
        Returns:
        a wrapperdefinition, or null
      • getClassByName

        public Class getClassByName​(String arg0)
        Description copied from interface: WrapperRegistry
        Returns null or a class based on its fully qualified class name.
        Specified by:
        getClassByName in interface WrapperRegistry
        Parameters:
        arg0 - Fully qualified classname
        Returns:
        null or a class based on its fully qualified class name
      • getInstance

        public Object getInstance​(String arg0)
        Description copied from interface: WrapperRegistry
        Returns an object instance based on its fully qualified class name.
        Specified by:
        getInstance in interface WrapperRegistry
        Parameters:
        arg0 - Fully qualified classname
        Returns:
        an object instance based on its fully qualified class name
      • getByObjectType

        public WrapperDefinition getByObjectType​(String objectTypeName)
        Needed for the SiteWorksWrapperFactory.
        Parameters:
        objectTypeName - the name of the objecttype
        Returns:
        the wrapperdefinition for the given objecttype, or null if it is not registered through (override)mappings.xml
      • getImplementingClass

        public Class getImplementingClass​(Class interfaceClass)
        Convenience method.
        Parameters:
        interfaceClass - the interface to get the implementation for
        Returns:
        the implementing class
      • getFactoryClass

        public Class getFactoryClass​(Class interfaceClass)
        Convenience method.
        Parameters:
        interfaceClass - the interface to get the factory for
        Returns:
        the factory class
      • isFromComponentRegistry

        public boolean isFromComponentRegistry​(Class targetClass)
        Returns whether the given interface/implementation class is registered in the component registry.
        Parameters:
        targetClass - the class to check
        Returns:
        true iff the given class is registered in the component registry
      • getObjectTypeNameByInterface

        public String getObjectTypeNameByInterface​(String interfaceClass)
        Return the name of the object type from the name of the interface
        Specified by:
        getObjectTypeNameByInterface in interface WrapperRegistry
        Parameters:
        interfaceClass - Name of the interface for which the corresponding object type name should be retrieved
        Returns:
        Object type name that corresponds to the given interface