Package nl.gx.webmanager.wrapper
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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CUSTOM_ELEMENT_CLASSDECL
static String
CUSTOM_ELEMENT_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
createInstance(String targetClassname)
Create new object of class represented by the string.Object
getInstance(int id, Class targetClass)
Returns an instance of the specified class wrapping the specified id.Object
getInstance(int id, 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 String CUSTOM_ELEMENT_TYPE
- See Also:
- Constant Field Values
-
CUSTOM_ELEMENT_CLASSDECL
static final 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
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
-
-