Save This Page
Home » sitemesh-2.3 » com.opensymphony.module » sitemesh » factory » [javadoc | source]
com.opensymphony.module.sitemesh.factory
abstract public class: BaseFactory [javadoc | source]
java.lang.Object
   com.opensymphony.module.sitemesh.Factory
      com.opensymphony.module.sitemesh.factory.BaseFactory

Direct Known Subclasses:
    DefaultFactory

Base Factory implementation. Provides utility methods for implementation.
Field Summary
protected  Config config    ServletConfig or FilterConfig. 
protected  DecoratorMapper decoratorMapper    Instance of com.opensymphony.module.sitemesh.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    Map that associates content-types with PageParser instances. 
protected  PathMapper excludeUrls    A map of paths that are excluded from decoration 
Constructor:
 protected BaseFactory(Config config) 
    Constructor for default implementation of Factory. Should never be called by client. Singleton instance should be obtained instead.
Method from com.opensymphony.module.sitemesh.factory.BaseFactory Summary:
addExcludeUrl,   clearDecoratorMappers,   clearExcludeUrls,   clearParserMappings,   getDecoratorMapper,   getPageParser,   isPathExcluded,   loadClass,   mapParser,   pushDecoratorMapper,   shouldParsePage
Methods from com.opensymphony.module.sitemesh.Factory:
getDecoratorMapper,   getInstance,   getPageParser,   isPathExcluded,   report,   shouldParsePage
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.module.sitemesh.factory.BaseFactory Detail:
 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.
 public DecoratorMapper getDecoratorMapper() 
    Return instance of DecoratorMapper.
 public PageParser getPageParser(String contentType) 
    Create a PageParser suitable for the given content-type.

    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.

 public boolean isPathExcluded(String path) 
    Returns true if the supplied path matches one of the exclude URLs specified in sitemesh.xml, otherwise returns false.
 public static Class loadClass(String className,
    Class callingClass) throws ClassNotFoundException 
 protected  void mapParser(String contentType,
    String className) 
    Map new PageParser to given content-type. contentType = null signifies default PageParser for unknown content-types.
 protected  void pushDecoratorMapper(String className,
    Properties properties) 
    Push new DecoratorMapper onto end of chain.
 public boolean shouldParsePage(String contentType) 
    Determine whether a Page of given content-type should be parsed or not.