|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider
public class XmlConfigurationProvider
Looks in the classpath for an XML file, "xwork.xml" by default, and uses it for the XWork configuration.
Field Summary | |
---|---|
private String |
configFileName
|
private Configuration |
configuration
|
private List<Document> |
documents
|
private Map<String,String> |
dtdMappings
|
private boolean |
errorIfMissing
|
private Set<String> |
includedFileNames
|
private Set<String> |
loadedFileUrls
|
private static Log |
LOG
|
private ObjectFactory |
objectFactory
|
Constructor Summary | |
---|---|
XmlConfigurationProvider()
|
|
XmlConfigurationProvider(String filename)
|
|
XmlConfigurationProvider(String filename,
boolean errorIfMissing)
|
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 |
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 Iterator<URL> |
getConfigurationUrls(String fileName)
|
Map<String,String> |
getDtdMappings()
Returns an unmodifiable map of DTD mappings |
int |
hashCode()
|
void |
init(Configuration configuration)
|
private List |
loadConfigurationFiles(String fileName,
Element includeElement)
|
protected void |
loadDefaultActionRef(PackageConfig packageContext,
Element element)
|
protected void |
loadDefaultClassRef(PackageConfig packageContext,
Element element)
|
protected void |
loadDefaultInterceptorRef(PackageConfig packageContext,
Element element)
|
private void |
loadDocuments(String configFileName)
|
protected void |
loadExtraConfiguration(Document doc)
Allows subclasses to load extra information from the document |
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)
|
void |
loadPackages()
|
private List |
lookupInterceptorReference(PackageConfig context,
Element interceptorRefElement)
Looks up the Interceptor Class from the interceptor-ref name and creates an instance, which is added to the provided List, or, if this is a ref to a stack, it adds the Interceptor instances from the List to this stack. |
boolean |
needsReload()
Tells whether the ConfigurationProvider should reload its configuration. |
void |
register(ContainerBuilder containerBuilder,
LocatableProperties props)
|
void |
setDtdMappings(Map<String,String> mappings)
|
void |
setObjectFactory(ObjectFactory objectFactory)
|
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 |
Field Detail |
---|
private static final Log LOG
private List<Document> documents
private Set<String> includedFileNames
private String configFileName
private ObjectFactory objectFactory
private Set<String> loadedFileUrls
private boolean errorIfMissing
private Map<String,String> dtdMappings
private Configuration configuration
Constructor Detail |
---|
public XmlConfigurationProvider()
public XmlConfigurationProvider(String filename)
public XmlConfigurationProvider(String filename, boolean errorIfMissing)
Method Detail |
---|
public void setDtdMappings(Map<String,String> mappings)
public void setObjectFactory(ObjectFactory objectFactory)
public Map<String,String> getDtdMappings()
public void init(Configuration configuration)
init
in interface ConfigurationProvider
public void destroy()
destroy
in interface ConfigurationProvider
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
private void loadDocuments(String configFileName)
public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException
register
in interface ConfigurationProvider
ConfigurationException
public void loadPackages() throws ConfigurationException
loadPackages
in interface ConfigurationProvider
ConfigurationException
public boolean needsReload()
needsReload
in interface ConfigurationProvider
protected void addAction(Element actionElement, PackageConfig packageContext) throws ConfigurationException
ConfigurationException
protected boolean verifyAction(String className, String name, Location loc)
protected void addPackage(Element packageElement) throws ConfigurationException
ConfigurationException
protected void addResultTypes(PackageConfig packageContext, Element element)
protected Class verifyResultType(String className, Location loc)
protected List buildInterceptorList(Element element, PackageConfig context) throws ConfigurationException
ConfigurationException
protected PackageConfig buildPackageContext(Element packageElement)
protected Map buildResults(Element element, PackageConfig packageContext)
protected List buildExceptionMappings(Element element, PackageConfig packageContext)
protected void loadDefaultInterceptorRef(PackageConfig packageContext, Element element)
protected void loadDefaultActionRef(PackageConfig packageContext, Element element)
protected void loadGlobalResults(PackageConfig packageContext, Element packageElement)
protected void loadDefaultClassRef(PackageConfig packageContext, Element element)
protected void loadGobalExceptionMappings(PackageConfig packageContext, Element packageElement)
protected InterceptorStackConfig loadInterceptorStack(Element element, PackageConfig context) throws ConfigurationException
ConfigurationException
protected void loadInterceptorStacks(Element element, PackageConfig context) throws ConfigurationException
ConfigurationException
protected void loadInterceptors(PackageConfig context, Element element) throws ConfigurationException
ConfigurationException
private List loadConfigurationFiles(String fileName, Element includeElement)
protected Iterator<URL> getConfigurationUrls(String fileName) throws IOException
IOException
protected void loadExtraConfiguration(Document doc)
doc
- The configuration documentprivate List lookupInterceptorReference(PackageConfig context, Element interceptorRefElement) throws ConfigurationException
interceptorRefElement
- Element to pull interceptor ref data fromcontext
- The PackageConfig to lookup the interceptor from
ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |