com.opensymphony.xwork.config.providers
Class XmlConfigurationProvider

java.lang.Object
  extended by com.opensymphony.xwork.config.providers.XmlConfigurationProvider
All Implemented Interfaces:
ConfigurationProvider

public class XmlConfigurationProvider
extends Object
implements ConfigurationProvider

Looks in the classpath for "xwork.xml" and uses it for the XWork configuration.

Version:
$Revision: 1083 $
Author:
tmjee, Rainer Hermanns, Neo

Constructor Summary
XmlConfigurationProvider()
           
XmlConfigurationProvider(String filename)
           
 
Method Summary
protected  void addAction(Element actionElement, PackageConfig packageContext)
           
protected  void addPackage(Element packageElement)
          Create a PackageConfig from an XML element representing it.
protected  void addResultTypes(PackageConfig packageContext, Element element)
           
protected  List buildExceptionMappings(Element element, PackageConfig packageContext)
          Build a map of ResultConfig objects from below a given XML element.
protected  List buildExternalRefs(Element element, PackageConfig context)
           
protected  List buildInterceptorList(Element element, PackageConfig context)
           
protected  PackageConfig buildPackageContext(Element packageElement)
          This method builds a package context by looking for the parents of this new package.
protected  Map buildResults(Element element, PackageConfig packageContext)
          Build a map of ResultConfig objects from below a given XML element.
 void destroy()
           
 boolean equals(Object o)
           
protected  InputStream getInputStream(String fileName)
           
 int hashCode()
           
 void init(Configuration configuration)
          Initializes the configuration object.
protected  void loadDefaultActionRef(PackageConfig packageContext, Element element)
           
protected  void loadDefaultInterceptorRef(PackageConfig packageContext, Element element)
           
protected  void loadGlobalResults(PackageConfig packageContext, Element packageElement)
          Load all of the global results for this package from the XML element.
protected  void loadGobalExceptionMappings(PackageConfig packageContext, Element packageElement)
          Load all of the global results for this package from the XML element.
protected  void loadInterceptors(PackageConfig context, Element element)
           
protected  InterceptorStackConfig loadInterceptorStack(Element element, PackageConfig context)
           
protected  void loadInterceptorStacks(Element element, PackageConfig context)
           
 boolean needsReload()
          Tells whether the ConfigurationProvider should reload its configuration.
protected  boolean verifyAction(String className, String name, Location loc)
           
protected  Class verifyResultType(String className, Location loc)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlConfigurationProvider

public XmlConfigurationProvider()

XmlConfigurationProvider

public XmlConfigurationProvider(String filename)
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface ConfigurationProvider

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

init

public void init(Configuration configuration)
Description copied from interface: ConfigurationProvider
Initializes the configuration object.

Specified by:
init in interface ConfigurationProvider

needsReload

public boolean needsReload()
Tells whether the ConfigurationProvider should reload its configuration. This method should only be called if ConfigurationManager.isReloadingConfigs() is true.

Specified by:
needsReload in interface ConfigurationProvider
Returns:
true if the file has been changed since the last time we read it

getInputStream

protected InputStream getInputStream(String fileName)

addAction

protected void addAction(Element actionElement,
                         PackageConfig packageContext)
                  throws ConfigurationException
Throws:
ConfigurationException

verifyAction

protected boolean verifyAction(String className,
                               String name,
                               Location loc)

addPackage

protected void addPackage(Element packageElement)
                   throws ConfigurationException
Create a PackageConfig from an XML element representing it.

Throws:
ConfigurationException

addResultTypes

protected void addResultTypes(PackageConfig packageContext,
                              Element element)

verifyResultType

protected Class verifyResultType(String className,
                                 Location loc)

buildExternalRefs

protected List buildExternalRefs(Element element,
                                 PackageConfig context)
                          throws ConfigurationException
Throws:
ConfigurationException

buildInterceptorList

protected List buildInterceptorList(Element element,
                                    PackageConfig context)
                             throws ConfigurationException
Throws:
ConfigurationException

buildPackageContext

protected PackageConfig buildPackageContext(Element packageElement)
This method builds a package context by looking for the parents of this new package.

If no parents are found, it will return a root package.


buildResults

protected Map buildResults(Element element,
                           PackageConfig packageContext)
Build a map of ResultConfig objects from below a given XML element.


buildExceptionMappings

protected List buildExceptionMappings(Element element,
                                      PackageConfig packageContext)
Build a map of ResultConfig objects from below a given XML element.


loadDefaultInterceptorRef

protected void loadDefaultInterceptorRef(PackageConfig packageContext,
                                         Element element)

loadDefaultActionRef

protected void loadDefaultActionRef(PackageConfig packageContext,
                                    Element element)

loadGlobalResults

protected void loadGlobalResults(PackageConfig packageContext,
                                 Element packageElement)
Load all of the global results for this package from the XML element.


loadGobalExceptionMappings

protected void loadGobalExceptionMappings(PackageConfig packageContext,
                                          Element packageElement)
Load all of the global results for this package from the XML element.


loadInterceptorStack

protected InterceptorStackConfig loadInterceptorStack(Element element,
                                                      PackageConfig context)
                                               throws ConfigurationException
Throws:
ConfigurationException

loadInterceptorStacks

protected void loadInterceptorStacks(Element element,
                                     PackageConfig context)
                              throws ConfigurationException
Throws:
ConfigurationException

loadInterceptors

protected void loadInterceptors(PackageConfig context,
                                Element element)
                         throws ConfigurationException
Throws:
ConfigurationException

XWork Project Page