| |
|
| java.lang.Object org.apache.struts.plugins.DigestingPlugIn
DigestingPlugIn | public class DigestingPlugIn implements PlugIn(Code) | | An implementation of PlugIn which can be configured to
instantiate a graph of objects using the Commons Digester and place the
root object of that graph into the Application context.
version: $Rev: 471754 $ See Also: org.apache.struts.action.PlugIn since: Struts 1.2 |
Constructor Summary | |
public | DigestingPlugIn() Constructor for DigestingPlugIn. |
SOURCE_CLASSPATH | final protected static String SOURCE_CLASSPATH(Code) | | |
SOURCE_SERVLET | final protected static String SOURCE_SERVLET(Code) | | |
push | protected boolean push(Code) | | |
DigestingPlugIn | public DigestingPlugIn()(Code) | | Constructor for DigestingPlugIn.
|
applyRuleSets | protected void applyRuleSets(Digester digester) throws ServletException(Code) | | Instantiate any RuleSet classes defined in the
rulesets property and use them to add rules to our
Digester .
Parameters: digester - the Digester instance to add RuleSet objects to. throws: ServletException - |
destroy | public void destroy()(Code) | | Receive notification that our owning module is being shut down.
|
digesterFromXml | protected Digester digesterFromXml(String path, String source) throws IOException(Code) | | Instantiate a Digester from an XML input stream using the Commons
DigesterLoader .
Parameters: path - the path to the digester rules XML to be found usingsource Parameters: source - a string indicating the lookup method to be used withpath a configured Digester throws: FileNotFoundException - throws: MalformedURLException - See Also: DigestingPlugIn.getConfigURL(String,String) |
getClassPathURL | protected URL getClassPathURL(String path)(Code) | | Given a string, return a URL to a classpath resource of that name.
Parameters: path - a Classpath-relative string identifying a resource. a URL identifying the resource on the classpath. TODO Do weneed to be smarter about ClassLoaders? |
getConfigURL | protected URL getConfigURL(String path, String source) throws IOException(Code) | | Look up a resource path using one of a set of known path resolution
mechanisms and return a URL to the resource.
Parameters: path - a String which is meaningful to one of the knownresolution mechanisms. Parameters: source - one of the known path resolution mechanisms:- file - the path is a fully-qualified filesystempath.
- servlet - the path is a servlet-context relativepath.
- classpath - the path is a classpath-relativepath.
a URL pointing to the given path in the given mechanism. throws: java.io.FileNotFoundException - throws: java.net.MalformedURLException - |
getFileURL | protected URL getFileURL(String path) throws IOException(Code) | | Given a string, return a URL to a Filesystem resource of that name.
Parameters: path - a path to a file. a URL identifying the resource in the in the file system. throws: MalformedURLException - throws: FileNotFoundException - |
getKey | public String getKey()(Code) | | The ServletContext attribute name the generated object isstored under. |
getPush | public boolean getPush()(Code) | | Whether or not this PlugIn instance will be pushedonto the Digester stack beforedigester.parse() is called. |
getRulesets | public String getRulesets()(Code) | | The configured list of RuleSet classes. |
getServletContextURL | protected URL getServletContextURL(String path) throws IOException(Code) | | Given a string, return a URL to a Servlet Context resource of that
name.
Parameters: path - a Classpath-relative string identifying a resource. a URL identifying the resource in the Servlet Context throws: MalformedURLException - |
init | public void init(ActionServlet servlet, ModuleConfig config) throws ServletException(Code) | | Initialize a Digester and use it to parse a
configuration file, resulting in a root object which will be placed
into the ServletContext.
Parameters: servlet - ActionServlet that is managing all the modules in thisweb application Parameters: config - ModuleConfig for the module with which this plug-in isassociated throws: ServletException - if this PlugIn cannot besuccessfully initialized |
initializeDigester | protected Digester initializeDigester() throws ServletException(Code) | | Initialize the Digester which will be used to process the
main configuration.
a Digester, ready to use. throws: ServletException - |
newDigesterInstance | protected Digester newDigesterInstance()(Code) | | Instantiate a Digester . Subclasses may wish to
override this to provide a subclass of Digester, or to configure the
Digester using object methods.
a basic instance of org.apache.commons.digester.Digester |
setConfigSource | public void setConfigSource(String configSource)(Code) | | Set the source of the config file. Should be one of the following:
- "classpath" - indicates that the configPath will be resolved
by the ClassLoader.
- "file" - indicates that the configPath
is a fully-qualified filesystem path.
- "servlet" - indicates
that the configPath will be found by the ServletContext.
Parameters: configSource - the source (lookup method) for the config file. See Also: DigestingPlugIn.configPath |
setKey | public void setKey(String key)(Code) | | Parameters: key - The ServletContext attribute name to store the generatedobject under. |
setPush | public void setPush(boolean push)(Code) | | If set to true , this PlugIn will be pushed onto the
Digester stack before the digester parse method is
called. Defaults to false
Parameters: push - |
setRulesets | public void setRulesets(String ruleSets)(Code) | | A comma-delimited list of one or more classes which implement
org.apache.commons.digester.RuleSet . (Optional)
|
storeGeneratedObject | protected void storeGeneratedObject(Object obj)(Code) | | This method is called after the Digester runs to store the generated
object somewhere. This implementation places the given object into the
ServletContext under the attribute name as defined in
key .
Parameters: obj - The object to save. |
|
|
|