|
||||||||||
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 java.util.Map |
factories
Loaded factories |
Constructor Summary | |
---|---|
FactorySet()
Constructor. |
Method Summary | |
---|---|
protected abstract DefinitionsFactory |
createFactory(java.lang.Object key,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Create a factory for specified key. |
protected abstract DefinitionsFactory |
getDefaultFactory()
Get default factory. |
ComponentDefinition |
getDefinition(java.lang.String name,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Get a definition by its name. |
protected abstract java.lang.Object |
getDefinitionsFactoryKey(java.lang.String name,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Extract key that will be used to get the sub factory. |
protected DefinitionsFactory |
getFactory(java.lang.Object key,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Get a factory by its key. |
abstract void |
initFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
Init factory set. |
java.lang.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 java.util.Map factories
Constructor Detail |
---|
public FactorySet()
Method Detail |
---|
protected abstract java.lang.Object getDefinitionsFactoryKey(java.lang.String name, javax.servlet.ServletRequest request, javax.servlet.ServletContext servletContext)
name
- Name of requested definition.request
- Current servlet request.servletContext
- Current servlet context.
protected abstract DefinitionsFactory getDefaultFactory()
protected DefinitionsFactory getFactory(java.lang.Object key, javax.servlet.ServletRequest request, javax.servlet.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(java.lang.String name, javax.servlet.ServletRequest request, javax.servlet.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(java.lang.Object key, javax.servlet.ServletRequest request, javax.servlet.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(javax.servlet.ServletContext servletContext, java.util.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 java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |