public class DefaultFactory extends BaseFactory
sitemesh.configfile
init param,
or /WEB-INF/sitemesh.xml
if not specified, or uses the
default configuration if sitemesh.xml
does not exist.
To use the sitemesh.configfile
parameter, 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>
Modifier and Type | Field and Description |
---|---|
static long |
configCheckMillis |
(package private) java.io.File |
configFile |
(package private) java.lang.String |
configFileName |
private long |
configLastCheck |
(package private) long |
configLastModified |
(package private) java.util.Map |
configProps |
private static java.lang.String |
DEFAULT_CONFIG_FILENAME |
(package private) java.io.File |
excludesFile |
(package private) java.lang.String |
excludesFileName |
config, decoratorMapper, excludeUrls, pageParsers
Constructor and Description |
---|
DefaultFactory(Config config) |
Modifier and Type | Method and Description |
---|---|
private void |
loadConfig()
Load configuration from file.
|
private void |
loadDecoratorMappers(org.w3c.dom.NodeList nodes) |
private void |
loadExcludes() |
private void |
loadExcludeUrls(org.w3c.dom.NodeList nodes)
Reads in all the url patterns to exclude from decoration.
|
private void |
loadPageParsers(org.w3c.dom.NodeList nodes)
Loop through children of 'page-parsers' element and add all 'parser' mappings.
|
private org.w3c.dom.Element |
loadSitemeshXML() |
void |
refresh()
Check if configuration file has been modified, and if so reload it.
|
private java.lang.String |
replaceProperties(java.lang.String str)
Replaces any properties that appear in the supplied string
with their actual values
|
addExcludeUrl, clearDecoratorMappers, clearExcludeUrls, clearParserMappings, getDecoratorMapper, getDecoratorMapper, getPageParser, isPathExcluded, mapParser, pushDecoratorMapper, shouldParsePage
getInstance
java.lang.String configFileName
private static final java.lang.String DEFAULT_CONFIG_FILENAME
java.io.File configFile
long configLastModified
private long configLastCheck
public static long configCheckMillis
java.util.Map configProps
java.lang.String excludesFileName
java.io.File excludesFile
public DefaultFactory(Config config)
private void loadConfig()
private org.w3c.dom.Element loadSitemeshXML() throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
private void loadExcludes() throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
private void loadPageParsers(org.w3c.dom.NodeList nodes)
private void loadDecoratorMappers(org.w3c.dom.NodeList nodes)
private void loadExcludeUrls(org.w3c.dom.NodeList nodes)
public void refresh()
private java.lang.String replaceProperties(java.lang.String str)
str
- the string to replace the properties in