|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.module.sitemesh.Factory
com.opensymphony.module.sitemesh.factory.BaseFactory
com.opensymphony.module.sitemesh.factory.DefaultFactory
public class DefaultFactory
DefaultFactory, reads configuration from /WEB-INF/sitemesh.xml
, or uses the
default configuration if sitemesh.xml
does not exist.
Field Summary | |
---|---|
(package private) File |
configFile
|
(package private) String |
configFileName
|
(package private) long |
configLastModified
|
(package private) Map |
configProps
|
(package private) File |
excludesFile
|
(package private) String |
excludesFileName
|
Fields inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory |
---|
config, decoratorMapper, excludeUrls, pageParsers |
Constructor Summary | |
---|---|
DefaultFactory(Config config)
|
Method Summary | |
---|---|
DecoratorMapper |
getDecoratorMapper()
Refresh config before delegating to superclass. |
PageParser |
getPageParser(String contentType)
Refresh config before delegating to superclass. |
boolean |
isPathExcluded(String path)
Returns true if the supplied path matches one of the exclude
URLs specified in sitemesh.xml, otherwise returns false . |
private void |
loadConfig()
Load configuration from file. |
private void |
loadDecoratorMappers(NodeList nodes)
|
private void |
loadExcludes()
|
private void |
loadExcludeUrls(NodeList nodes)
Reads in all the url patterns to exclude from decoration. |
private void |
loadPageParsers(NodeList nodes)
Loop through children of 'page-parsers' element and add all 'parser' mappings. |
private Element |
loadSitemeshXML()
|
private void |
refresh()
Check if configuration file has been modified, and if so reload it. |
private String |
replaceProperties(String str)
Replaces any properties that appear in the supplied string with their actual values |
boolean |
shouldParsePage(String contentType)
Refresh config before delegating to superclass. |
Methods inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory |
---|
addExcludeUrl, clearDecoratorMappers, clearExcludeUrls, clearParserMappings, mapParser, pushDecoratorMapper |
Methods inherited from class com.opensymphony.module.sitemesh.Factory |
---|
getInstance, report |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
String configFileName
File configFile
long configLastModified
Map configProps
String excludesFileName
File excludesFile
Constructor Detail |
---|
public DefaultFactory(Config config)
Method Detail |
---|
public DecoratorMapper getDecoratorMapper()
getDecoratorMapper
in class BaseFactory
public PageParser getPageParser(String contentType)
getPageParser
in class BaseFactory
contentType
- The MIME content-type of the data to be parsed
PageParser
for reading data, or
null
if no suitable parser was found.public boolean shouldParsePage(String contentType)
shouldParsePage
in class BaseFactory
public boolean isPathExcluded(String path)
true
if the supplied path matches one of the exclude
URLs specified in sitemesh.xml, otherwise returns false
. This
method refreshes the config before delgating to the superclass.
isPathExcluded
in class BaseFactory
private void loadConfig()
private Element loadSitemeshXML() throws ParserConfigurationException, IOException, SAXException
ParserConfigurationException
IOException
SAXException
private void loadExcludes() throws ParserConfigurationException, IOException, SAXException
ParserConfigurationException
IOException
SAXException
private void loadPageParsers(NodeList nodes)
private void loadDecoratorMappers(NodeList nodes)
private void loadExcludeUrls(NodeList nodes)
private void refresh()
private String replaceProperties(String str)
str
- the string to replace the properties in
|
www.opensymphony.com/sitemesh/ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |