Class XmlConfigurationProvider
java.lang.Object
org.apache.struts2.config.providers.XmlDocConfigurationProvider
org.apache.struts2.config.providers.XmlConfigurationProvider
- All Implemented Interfaces:
ConfigurationProvider
,ContainerProvider
,PackageProvider
- Direct Known Subclasses:
StrutsXmlConfigurationProvider
Looks in the classpath for an XML file, "struts.xml" by default,
and uses it for the XWork configuration.
- Version:
- $Revision$
- Author:
- tmjee, Rainer Hermanns, Neo
-
Field Summary
Fields inherited from class org.apache.struts2.config.providers.XmlDocConfigurationProvider
allowlistClasses, configuration, declaredPackages, documents, dtdMappings, objectFactory, providerAllowlist, throwExceptionOnDuplicateBeans, valueSubstitutor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getConfigurationUrls
(String fileName) getFinalDocs
(List<Document> docs) int
hashCode()
void
init
(Configuration configuration) Initializes with the configurationloadConfigurationFiles
(String fileName, Element includeElement) void
Loads the packages for the configuration.boolean
Tells whether the ConfigurationProvider should reload its configuration.void
register
(ContainerBuilder containerBuilder, LocatableProperties props) Registers beans and properties for the Containervoid
setFileManagerFactory
(FileManagerFactory fileManagerFactory) toString()
Methods inherited from class org.apache.struts2.config.providers.XmlDocConfigurationProvider
addAction, addAllowedMethodsToSet, addPackage, addResultTypes, allowAndLoadClass, buildActionConfig, buildAllowedMethods, buildExceptionMappings, buildInterceptorConfig, buildInterceptorList, buildPackageContext, buildResultConfig, buildResultParams, buildResults, buildResultTypeConfig, destroy, getDtdMappings, guessResultType, iterateChildren, iterateChildrenByTagName, iterateElementChildren, iterateElementChildren, loadClass, loadDefaultActionRef, loadDefaultClassRef, loadDefaultInterceptorRef, loadExtraConfiguration, loadGlobalAllowedMethods, loadGlobalExceptionMappings, loadGlobalResults, loadInterceptors, loadInterceptorStack, loadInterceptorStacks, lookupInterceptorReference, registerBean, registerBeanSelection, registerConstant, registerUnknownHandlerStack, setDtdMappings, setObjectFactory, setProviderAllowlist, setThrowExceptionOnDuplicateBeans, setValueSubstitutor, verifyAction, verifyInterceptor, verifyResultType
-
Field Details
-
fileManager
-
-
Constructor Details
-
XmlConfigurationProvider
public XmlConfigurationProvider() -
XmlConfigurationProvider
-
-
Method Details
-
setFileManagerFactory
-
init
Description copied from interface:ContainerProvider
Initializes with the configuration- Specified by:
init
in interfaceContainerProvider
- Specified by:
init
in interfacePackageProvider
- Overrides:
init
in classXmlDocConfigurationProvider
- Parameters:
configuration
- The configuration
-
loadPackages
Description copied from interface:PackageProvider
Loads the packages for the configuration.- Specified by:
loadPackages
in interfacePackageProvider
- Overrides:
loadPackages
in classXmlDocConfigurationProvider
- Throws:
ConfigurationException
- in case of configuration errors
-
register
public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException Description copied from interface:ContainerProvider
Registers beans and properties for the Container- Specified by:
register
in interfaceContainerProvider
- Overrides:
register
in classXmlDocConfigurationProvider
- Parameters:
containerBuilder
- The builder to register beans withprops
- The properties to register constants with- Throws:
ConfigurationException
- If anything goes wrong
-
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 interfaceContainerProvider
- Specified by:
needsReload
in interfacePackageProvider
- Overrides:
needsReload
in classXmlDocConfigurationProvider
- Returns:
- true if the file has been changed since the last time we read it
-
parseFile
-
loadConfigurationFiles
-
getURLs
-
getConfigurationUrls
- Throws:
IOException
-
getDocs
-
getFinalDocs
-
equals
-
hashCode
public int hashCode() -
toString
-