Interface WrapperFactory

  • All Known Implementing Classes:
    PersonalizationFactory, SimpleFactory, SiteWorksWrapperFactory

    public interface WrapperFactory
    This class defines the api for a factory for creating new webmanager objects. A factory should have a public default contstructor and implements the setters for the servlet request and response that can be used for creating new instances. After the factory has been created and the setters have been invoked, then the createInstance method will be used for creating a new instance of a specified type, with the specified id.
    • Method Detail

      • setHttpServletRequest

        void setHttpServletRequest​(javax.servlet.http.HttpServletRequest request)
        Set the request object.
        Parameters:
        request - The request for the factory, that can be used for creating new instances.
      • setHttpServletResponse

        void setHttpServletResponse​(javax.servlet.http.HttpServletResponse response)
        Set the response object.
        Parameters:
        response - The request for the factory
      • getInstance

        Object getInstance​(int id,
                           Class targetClass)
        Returns an instance of the specified class wrapping the specified id.
        Parameters:
        id - The identifier for the new instance.
        targetClass - The type of the new instance
        Returns:
        The new instance of the specified type, with the specified id.
      • getInstance

        Object getInstance​(int id,
                           String targetClassname)
        Returns an instance of the class represented by the given string. Needed for classes that are only loaded in the framework and not in SiteWorks.
        Parameters:
        id -
        targetClassname -
        Returns:
        Object with HtmlObject-id id and of class represented by targetClassname
      • createInstance

        Object createInstance​(String targetClassname)
        Create new object of class represented by the string. Should be a fully qualified classname
        Parameters:
        targetClassname -
        Returns:
        Object of given class