org.apache.struts.plugins
クラス DigestingPlugIn

java.lang.Object
  拡張org.apache.struts.plugins.DigestingPlugIn
すべての実装インタフェース:
PlugIn

public class DigestingPlugIn
extends java.lang.Object
implements PlugIn

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.

導入されたバージョン:
Struts 1.2
バージョン:
$Revision: 1.1 $
関連項目:
PlugIn

フィールドの概要
protected  java.lang.String configPath
           
protected  java.lang.String configSource
           
protected  java.lang.String digesterPath
           
protected  java.lang.String digesterSource
           
protected  java.lang.String key
           
private static org.apache.commons.logging.Log log
          Commons Logging instance.
protected  ModuleConfig moduleConfig
           
protected  boolean push
           
protected  java.lang.String rulesets
           
protected  ActionServlet servlet
           
protected static java.lang.String SOURCE_CLASSPATH
           
protected static java.lang.String SOURCE_FILE
           
protected static java.lang.String SOURCE_SERVLET
           
 
コンストラクタの概要
DigestingPlugIn()
          Constructor for DigestingPlugIn.
 
メソッドの概要
protected  void applyRuleSets(org.apache.commons.digester.Digester digester)
          Instantiate any RuleSet classes defined in the rulesets property and use them to add rules to our Digester.
 void destroy()
          Receive notification that our owning module is being shut down.
protected  org.apache.commons.digester.Digester digesterFromXml(java.lang.String path, java.lang.String source)
          Instantiate a Digester from an XML input stream using the Commons DigesterLoader.
protected  java.net.URL getClassPathURL(java.lang.String path)
          Given a string, return a URL to a classpath resource of that name.
 java.lang.String getConfigPath()
           
 java.lang.String getConfigSource()
           
protected  java.net.URL getConfigURL(java.lang.String path, java.lang.String source)
          Look up a resource path using one of a set of known path resolution mechanisms and return a URL to the resource.
 java.lang.String getDigesterPath()
           
 java.lang.String getDigesterSource()
           
protected  java.net.URL getFileURL(java.lang.String path)
          Given a string, return a URL to a Filesystem resource of that name.
 java.lang.String getKey()
           
 boolean getPush()
           
 java.lang.String getRulesets()
           
protected  java.net.URL getServletContextURL(java.lang.String path)
          Given a string, return a URL to a Servlet Context resource of that name.
 void init(ActionServlet servlet, ModuleConfig config)
          Initialize a Digester and use it to parse a configuration file, resulting in a root object which will be placed into the ServletContext.
protected  org.apache.commons.digester.Digester initializeDigester()
          Initialize the Digester which will be used to process the main configuration.
protected  org.apache.commons.digester.Digester newDigesterInstance()
          Instantiate a Digester.
 void setConfigPath(java.lang.String configPath)
           
 void setConfigSource(java.lang.String configSource)
          Set the source of the config file.
 void setDigesterPath(java.lang.String digesterPath)
          The path to a Digester XML configuration file, relative to the digesterSource property.
 void setDigesterSource(java.lang.String digesterSource)
          The lookup mechanism to be used to resolve digesterPath (optional).
 void setKey(java.lang.String key)
           
 void setPush(boolean push)
          If set to true, this PlugIn will be pushed onto the Digester stack before the digester parse method is called.
 void setRulesets(java.lang.String ruleSets)
          A comma-delimited list of one or more classes which implement org.apache.commons.digester.RuleSet.
protected  void storeGeneratedObject(java.lang.Object obj)
          This method is called after the Digester runs to store the generated object somewhere.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

log

private static org.apache.commons.logging.Log log
Commons Logging instance.


SOURCE_CLASSPATH

protected static final java.lang.String SOURCE_CLASSPATH
関連項目:
定数フィールド値

SOURCE_FILE

protected static final java.lang.String SOURCE_FILE
関連項目:
定数フィールド値

SOURCE_SERVLET

protected static final java.lang.String SOURCE_SERVLET
関連項目:
定数フィールド値

configPath

protected java.lang.String configPath

configSource

protected java.lang.String configSource

digesterPath

protected java.lang.String digesterPath

digesterSource

protected java.lang.String digesterSource

key

protected java.lang.String key

moduleConfig

protected ModuleConfig moduleConfig

rulesets

protected java.lang.String rulesets

servlet

protected ActionServlet servlet

push

protected boolean push
コンストラクタの詳細

DigestingPlugIn

public DigestingPlugIn()
Constructor for DigestingPlugIn.

メソッドの詳細

destroy

public void destroy()
Receive notification that our owning module is being shut down.

定義:
インタフェース PlugIn 内の destroy

init

public void init(ActionServlet servlet,
                 ModuleConfig config)
          throws javax.servlet.ServletException

Initialize a Digester and use it to parse a configuration file, resulting in a root object which will be placed into the ServletContext.

定義:
インタフェース PlugIn 内の init
パラメータ:
servlet - ActionServlet that is managing all the modules in this web application
config - ModuleConfig for the module with which this plug-in is associated
例外:
javax.servlet.ServletException - if this PlugIn cannot be successfully initialized

initializeDigester

protected org.apache.commons.digester.Digester initializeDigester()
                                                           throws javax.servlet.ServletException
Initialize the Digester which will be used to process the main configuration.

戻り値:
a Digester, ready to use.
例外:
javax.servlet.ServletException

newDigesterInstance

protected org.apache.commons.digester.Digester newDigesterInstance()

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

digesterFromXml

protected org.apache.commons.digester.Digester digesterFromXml(java.lang.String path,
                                                               java.lang.String source)
                                                        throws java.io.IOException

Instantiate a Digester from an XML input stream using the Commons DigesterLoader.

パラメータ:
path - the path to the digester rules XML to be found using source
source - a string indicating the lookup method to be used with path
戻り値:
a configured Digester
例外:
FileNotFoundException
MalformedURLException
java.io.IOException
関連項目:
getConfigURL(String, String)

applyRuleSets

protected void applyRuleSets(org.apache.commons.digester.Digester digester)
                      throws javax.servlet.ServletException
Instantiate any RuleSet classes defined in the rulesets property and use them to add rules to our Digester.

パラメータ:
digester - the Digester instance to add RuleSet objects to.
例外:
javax.servlet.ServletException

getConfigURL

protected java.net.URL getConfigURL(java.lang.String path,
                                    java.lang.String source)
                             throws java.io.IOException

Look up a resource path using one of a set of known path resolution mechanisms and return a URL to the resource.

パラメータ:
path - a String which is meaningful to one of the known resolution mechanisms.
source - one of the known path resolution mechanisms:
  • file - the path is a fully-qualified filesystem path.
  • servlet - the path is a servlet-context relative path.
  • classpath - the path is a classpath-relative path.
戻り値:
a URL pointing to the given path in the given mechanism.
例外:
FileNotFoundException
MalformedURLException
java.io.IOException

getClassPathURL

protected java.net.URL getClassPathURL(java.lang.String path)
Given a string, return a URL to a classpath resource of that name.

パラメータ:
path - a Classpath-relative string identifying a resource.
戻り値:
a URL identifying the resource on the classpath. TODO Do we need to be smarter about ClassLoaders?

getServletContextURL

protected java.net.URL getServletContextURL(java.lang.String path)
                                     throws java.io.IOException
Given a string, return a URL to a Servlet Context resource of that name.

パラメータ:
path - a Classpath-relative string identifying a resource.
戻り値:
a URL identifying the resource in the Servlet Context
例外:
MalformedURLException
java.io.IOException

getFileURL

protected java.net.URL getFileURL(java.lang.String path)
                           throws java.io.IOException
Given a string, return a URL to a Filesystem resource of that name.

パラメータ:
path - a path to a file.
戻り値:
a URL identifying the resource in the in the file system.
例外:
MalformedURLException
FileNotFoundException
java.io.IOException

setConfigPath

public void setConfigPath(java.lang.String configPath)
パラメータ:
configPath - the path to configuration information for this PlugIn.
関連項目:
configSource

getConfigPath

public java.lang.String getConfigPath()
戻り値:
the configPath property
関連項目:
configSource

setConfigSource

public void setConfigSource(java.lang.String configSource)
Set the source of the config file. Should be one of the following:

パラメータ:
configSource - the source (lookup method) for the config file.
関連項目:
configPath

getConfigSource

public java.lang.String getConfigSource()
戻り値:
the string describing which access method should be used to resolve configPath.
関連項目:
configPath

storeGeneratedObject

protected void storeGeneratedObject(java.lang.Object obj)
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.

パラメータ:
obj - The object to save.

setKey

public void setKey(java.lang.String key)
パラメータ:
key - The ServletContext attribute name to store the generated object under.

getKey

public java.lang.String getKey()
戻り値:
The ServletContext attribute name the generated object is stored under.

setRulesets

public void setRulesets(java.lang.String ruleSets)

A comma-delimited list of one or more classes which implement org.apache.commons.digester.RuleSet. (Optional)


getRulesets

public java.lang.String getRulesets()
戻り値:
The configured list of RuleSet classes.

setDigesterPath

public void setDigesterPath(java.lang.String digesterPath)

The path to a Digester XML configuration file, relative to the digesterSource property. (Optional)

関連項目:
digesterSource, getConfigURL(String, String)

getDigesterPath

public java.lang.String getDigesterPath()
戻り値:
the configured path to a Digester XML config file, or null.
関連項目:
digesterSource, getConfigURL(String, String)

setDigesterSource

public void setDigesterSource(java.lang.String digesterSource)

The lookup mechanism to be used to resolve digesterPath (optional).

パラメータ:
digesterSource -
関連項目:
getConfigURL(String, String)

getDigesterSource

public java.lang.String getDigesterSource()
戻り値:
the configured lookup mechanism for resolving digesterPath.
関連項目:
getConfigURL(String, String)

setPush

public void setPush(boolean push)

If set to true, this PlugIn will be pushed onto the Digester stack before the digester parse method is called.

Defaults to false

パラメータ:
push -

getPush

public boolean getPush()
戻り値:
Whether or not this PlugIn instance will be pushed onto the Digester stack before digester.parse() is called.


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation