Class Factory

java.lang.Object
com.opensymphony.module.sitemesh.Factory
Direct Known Subclasses:
BaseFactory

public abstract class Factory extends Object
Factory responsible for creating appropriate instances of implementations. This is specific to a web context and is obtained through getInstance(com.opensymphony.module.sitemesh.Config).

The actual Factory method used is determined by the enviroment entry sitemesh.factory. If this doesn't exist, it defaults to DefaultFactory .

Version:
$Revision: 1.5 $
Author:
Joe Walnes
  • Field Details

  • Constructor Details

    • Factory

      public Factory()
  • Method Details

    • getInstance

      public static Factory getInstance(Config config)
      Entry-point for obtaining singleton instance of Factory. The default factory class that will be instantiated can be overridden with the environment entry sitemesh.factory.
    • getDecoratorMapper

      public abstract DecoratorMapper getDecoratorMapper()
      Return instance of DecoratorMapper.
    • getPageParser

      public abstract 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.

      Never returns null.
      Parameters:
      contentType - The MIME content-type of the data to be parsed
      Returns:
      Appropriate PageParser for reading data
    • shouldParsePage

      public abstract boolean shouldParsePage(String contentType)
      Determine whether a Page of given content-type should be parsed or not.
    • isPathExcluded

      public abstract boolean isPathExcluded(String path)
      Determine whether the given path should be excluded from decoration or not.
    • report

      protected static void report(String msg, Exception e)
      Report a problem.
    • getEnvEntry

      private static String getEnvEntry(String envEntry, String defaultValue)
      Find String environment entry, or return default if not found.