Class DefaultFactory
- java.lang.Object
-
- com.opensymphony.module.sitemesh.Factory
-
- com.opensymphony.module.sitemesh.factory.BaseFactory
-
- com.opensymphony.module.sitemesh.factory.DefaultFactory
-
- All Implemented Interfaces:
PageParserSelector
public class DefaultFactory extends BaseFactory
DefaultFactory, reads configuration from thesitemesh.configfileinit param, or/WEB-INF/sitemesh.xmlif not specified, or uses the default configuration ifsitemesh.xmldoes not exist.To use the
sitemesh.configfileparameter, add the following to your web.xml:<context-param> <param-name>sitemesh.configfile</param-name> <param-value>/WEB-INF/etc/sitemesh.xml</param-value> </context-param>- Version:
- $Revision: 1.8 $
- Author:
- Joe Walnes, Mathias Bogaert
-
-
Field Summary
Fields Modifier and Type Field Description static longconfigCheckMillis(package private) FileconfigFile(package private) StringconfigFileNameprivate longconfigLastCheck(package private) longconfigLastModified(package private) MapconfigPropsprivate static StringDEFAULT_CONFIG_FILENAME(package private) FileexcludesFile(package private) StringexcludesFileName-
Fields inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory
config, decoratorMapper, excludeUrls, pageParsers
-
-
Constructor Summary
Constructors Constructor Description DefaultFactory(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidloadConfig()Load configuration from file.private voidloadDecoratorMappers(NodeList nodes)private voidloadExcludes()private voidloadExcludeUrls(NodeList nodes)Reads in all the url patterns to exclude from decoration.private voidloadPageParsers(NodeList nodes)Loop through children of 'page-parsers' element and add all 'parser' mappings.private ElementloadSitemeshXML()voidrefresh()Check if configuration file has been modified, and if so reload it.private StringreplaceProperties(String str)Replaces any properties that appear in the supplied string with their actual values-
Methods inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory
addExcludeUrl, clearDecoratorMappers, clearExcludeUrls, clearParserMappings, getDecoratorMapper, getDecoratorMapper, getPageParser, isPathExcluded, mapParser, pushDecoratorMapper, shouldParsePage
-
Methods inherited from class com.opensymphony.module.sitemesh.Factory
getInstance
-
-
-
-
Field Detail
-
configFileName
String configFileName
-
DEFAULT_CONFIG_FILENAME
private static final String DEFAULT_CONFIG_FILENAME
- See Also:
- Constant Field Values
-
configFile
File configFile
-
configLastModified
long configLastModified
-
configLastCheck
private long configLastCheck
-
configCheckMillis
public static long configCheckMillis
-
configProps
Map configProps
-
excludesFileName
String excludesFileName
-
excludesFile
File excludesFile
-
-
Constructor Detail
-
DefaultFactory
public DefaultFactory(Config config)
-
-
Method Detail
-
loadConfig
private void loadConfig()
Load configuration from file.
-
loadSitemeshXML
private Element loadSitemeshXML() throws ParserConfigurationException, IOException, SAXException
-
loadExcludes
private void loadExcludes() throws ParserConfigurationException, IOException, SAXException
-
loadPageParsers
private void loadPageParsers(NodeList nodes)
Loop through children of 'page-parsers' element and add all 'parser' mappings.
-
loadDecoratorMappers
private void loadDecoratorMappers(NodeList nodes)
-
loadExcludeUrls
private void loadExcludeUrls(NodeList nodes)
Reads in all the url patterns to exclude from decoration.
-
refresh
public void refresh()
Check if configuration file has been modified, and if so reload it.
-
-