Class DefaultFactory
java.lang.Object
com.opensymphony.module.sitemesh.Factory
com.opensymphony.module.sitemesh.factory.BaseFactory
com.opensymphony.module.sitemesh.factory.DefaultFactory
DefaultFactory, reads configuration from
/WEB-INF/sitemesh.xml, or uses the
default configuration if sitemesh.xml does not exist.- Version:
- $Revision: 1.3 $
- Author:
- Joe Walnes, Mathias Bogaert
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) File(package private) String(package private) long(package private) Map(package private) File(package private) StringFields inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory
config, decoratorMapper, excludeUrls, pageParsers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRefresh config before delegating to superclass.getPageParser(String contentType) Refresh config before delegating to superclass.booleanisPathExcluded(String path) Returnstrueif the supplied path matches one of the exclude URLs specified in sitemesh.xml, otherwise returnsfalse.private voidLoad configuration from file.private voidloadDecoratorMappers(NodeList nodes) private voidprivate 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 Elementprivate 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 valuesbooleanshouldParsePage(String contentType) Refresh config before delegating to superclass.Methods inherited from class com.opensymphony.module.sitemesh.factory.BaseFactory
addExcludeUrl, clearDecoratorMappers, clearExcludeUrls, clearParserMappings, mapParser, pushDecoratorMapperMethods inherited from class com.opensymphony.module.sitemesh.Factory
getInstance, report
-
Field Details
-
Constructor Details
-
DefaultFactory
-
-
Method Details
-
getDecoratorMapper
Refresh config before delegating to superclass.- Overrides:
getDecoratorMapperin classBaseFactory
-
getPageParser
Refresh config before delegating to superclass.- Overrides:
getPageParserin classBaseFactory- Parameters:
contentType- The MIME content-type of the data to be parsed- Returns:
- Appropriate
PageParserfor reading data, ornullif no suitable parser was found.
-
shouldParsePage
Refresh config before delegating to superclass.- Overrides:
shouldParsePagein classBaseFactory
-
isPathExcluded
Returnstrueif the supplied path matches one of the exclude URLs specified in sitemesh.xml, otherwise returnsfalse. This method refreshes the config before delgating to the superclass.- Overrides:
isPathExcludedin classBaseFactory- Parameters:
path-- Returns:
- whether the path is excluded
-
loadConfig
private void loadConfig()Load configuration from file. -
loadSitemeshXML
-
loadExcludes
-
loadPageParsers
Loop through children of 'page-parsers' element and add all 'parser' mappings. -
loadDecoratorMappers
-
loadExcludeUrls
Reads in all the url patterns to exclude from decoration. -
refresh
private void refresh()Check if configuration file has been modified, and if so reload it. -
replaceProperties
Replaces any properties that appear in the supplied string with their actual values- Parameters:
str- the string to replace the properties in- Returns:
- the same string but with any properties expanded out to their actual values
-