nl.gx.webmanager.wrapper
Interface WrapperFactory


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.


Field Summary
static java.lang.String CUSTOM_ELEMENT_CLASSDECL
           
static java.lang.String CUSTOM_ELEMENT_TYPE
           
 
Method Summary
 java.lang.Object createInstance(java.lang.String targetClassname)
          Create new object of class represented by the string.
 java.lang.Object getInstance(int id, java.lang.Class targetClass)
          Returns an instance of the specified class wrapping the specified id.
 java.lang.Object getInstance(int id, java.lang.String targetClassname)
          Returns an instance of the class represented by the given string.
 void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
          Set the request object.
 void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
          Set the response object.
 

Field Detail

CUSTOM_ELEMENT_TYPE

static final java.lang.String CUSTOM_ELEMENT_TYPE
See Also:
Constant Field Values

CUSTOM_ELEMENT_CLASSDECL

static final java.lang.String CUSTOM_ELEMENT_CLASSDECL
See Also:
Constant Field Values
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

java.lang.Object getInstance(int id,
                             java.lang.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

java.lang.Object getInstance(int id,
                             java.lang.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

java.lang.Object createInstance(java.lang.String targetClassname)
Create new object of class represented by the string. Should be a fully qualified classname

Parameters:
targetClassname -
Returns:
Object of given class


Copyright © 2007-2011 GX Software BV. All Rights Reserved.