|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.tiles.xmlDefinition.FactorySet
public abstract class FactorySet
Component Definitions factory. This factory contains several factories identified by a key. The getDefinition() method first looks for the factory key, retrieves or creates this factory and then calls its getDefinition().
Field Summary | |
---|---|
protected Map |
factories
Loaded factories |
Constructor Summary | |
---|---|
FactorySet()
Constructor. |
Method Summary | |
---|---|
protected abstract DefinitionsFactory |
createFactory(Object key,
ServletRequest request,
ServletContext servletContext)
Create a factory for specified key. |
protected abstract DefinitionsFactory |
getDefaultFactory()
Get default factory. |
ComponentDefinition |
getDefinition(String name,
ServletRequest request,
ServletContext servletContext)
Get a definition by its name. |
protected abstract Object |
getDefinitionsFactoryKey(String name,
ServletRequest request,
ServletContext servletContext)
Extract key that will be used to get the sub factory. |
protected DefinitionsFactory |
getFactory(Object key,
ServletRequest request,
ServletContext servletContext)
Get a factory by its key. |
abstract void |
initFactory(ServletContext servletContext,
Map properties)
Init factory set. |
String |
toString()
Return String representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Map factories
Constructor Detail |
---|
public FactorySet()
Method Detail |
---|
protected abstract Object getDefinitionsFactoryKey(String name, ServletRequest request, ServletContext servletContext)
name
- Name of requested definition.request
- Current servlet request.servletContext
- Current servlet context.
protected abstract DefinitionsFactory getDefaultFactory()
protected DefinitionsFactory getFactory(Object key, ServletRequest request, ServletContext servletContext) throws DefinitionsFactoryException
null
, return defaultFactory.
Search in loaded factories. If not found, create factory and store return value in
loaded factories.
key
- Key of requested definition.request
- Current servlet request.servletContext
- Current servlet context.
DefinitionsFactoryException
- If an error occur while creating factory.public ComponentDefinition getDefinition(String name, ServletRequest request, ServletContext servletContext) throws NoSuchDefinitionException, DefinitionsFactoryException
getDefinition
in interface ComponentDefinitionsFactory
name
- Name of requested definition.request
- Current servlet request.servletContext
- Current servlet context.
NoSuchDefinitionException
- No definition found for specified name
DefinitionsFactoryException
- General exceptionprotected abstract DefinitionsFactory createFactory(Object key, ServletRequest request, ServletContext servletContext) throws DefinitionsFactoryException
key
- Key of requested definition.request
- Current servlet request.servletContext
- Current servlet context
DefinitionsFactoryException
- If an error occur while creating factory.public abstract void initFactory(ServletContext servletContext, Map properties) throws DefinitionsFactoryException
initFactory
in interface ComponentDefinitionsFactory
servletContext
- Current servlet contextproperties
- properties used to initialized factory set;
DefinitionsFactoryException
- An error occur during initialization.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |