|
||||||||||
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
public abstract class BaseFactory
Base Factory implementation. Provides utility methods for implementation.
Field Summary | |
---|---|
protected Config |
config
ServletConfig or FilterConfig. |
protected DecoratorMapper |
decoratorMapper
Instance of DecoratorMapper . |
protected PathMapper |
excludeUrls
A map of paths that are excluded from decoration |
protected Map |
pageParsers
Map that associates content-types with PageParser instances. |
Constructor Summary | |
---|---|
protected |
BaseFactory(Config config)
Constructor for default implementation of Factory. |
Method Summary | |
---|---|
protected void |
addExcludeUrl(String path)
|
protected void |
clearDecoratorMappers()
Clear all current DecoratorMappers. |
protected void |
clearExcludeUrls()
Clears all exclude URLs. |
protected void |
clearParserMappings()
Clear all PageParser mappings. |
DecoratorMapper |
getDecoratorMapper()
Return instance of DecoratorMapper. |
protected DecoratorMapper |
getDecoratorMapper(Class decoratorMapperClass)
|
PageParser |
getPageParser(String contentType)
Create a PageParser suitable for the given content-type. |
boolean |
isPathExcluded(String path)
Returns true if the supplied path matches one of the exclude
URLs specified in sitemesh.xml, otherwise returns false . |
protected void |
mapParser(String contentType,
String className)
Map new PageParser to given content-type. |
protected void |
pushDecoratorMapper(String className,
Properties properties)
Push new DecoratorMapper onto end of chain. |
boolean |
shouldParsePage(String contentType)
Determine whether a Page of given content-type should be parsed or not. |
Methods inherited from class com.opensymphony.module.sitemesh.Factory |
---|
getInstance, refresh |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Config config
protected DecoratorMapper decoratorMapper
DecoratorMapper
.
Because it is thread-safe, it can be shared by multiple clients. This
is only the last DecoratorMapper in the chain, and all parents will be
automatically delegated to it.
protected Map pageParsers
protected PathMapper excludeUrls
Constructor Detail |
---|
protected BaseFactory(Config config)
Factory.getInstance(com.opensymphony.module.sitemesh.Config config)
Method Detail |
---|
public DecoratorMapper getDecoratorMapper()
getDecoratorMapper
in class Factory
public PageParser getPageParser(String contentType)
For example, if the supplied parameter is text/html
a parser shall be returned that can parse HTML accordingly. Returns
null if no parser can be found for the supplied content type.
getPageParser
in interface PageParserSelector
getPageParser
in class Factory
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 interface PageParserSelector
shouldParsePage
in class Factory
public boolean isPathExcluded(String path)
true
if the supplied path matches one of the exclude
URLs specified in sitemesh.xml, otherwise returns false
.
isPathExcluded
in class Factory
path
-
protected void clearDecoratorMappers()
protected void pushDecoratorMapper(String className, Properties properties)
protected DecoratorMapper getDecoratorMapper(Class decoratorMapperClass) throws InstantiationException, IllegalAccessException
InstantiationException
IllegalAccessException
protected void clearParserMappings()
protected void mapParser(String contentType, String className)
protected void addExcludeUrl(String path)
protected void clearExcludeUrls()
|
www.opensymphony.com/sitemesh/ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |