Home » Struts-1.3.10 » org.apache.struts » tiles » xmlDefinition » [javadoc | source]
org.apache.struts.tiles.xmlDefinition
public class: I18nFactorySet [javadoc | source]
java.lang.Object
   org.apache.struts.tiles.xmlDefinition.FactorySet
      org.apache.struts.tiles.xmlDefinition.I18nFactorySet

All Implemented Interfaces:
    ComponentDefinitionsFactory

Direct Known Subclasses:
    CustomI18nFactorySet

Definitions factory. This implementation allows to have a set of definition factories. There is a main factory and one factory for each file associated to a Locale. To retrieve a definition, we first search for the appropriate factory using the Locale found in session context. If no factory is found, use the default one. Then we ask the factory for the definition. A definition factory file is loaded using main filename extended with locale code (ex : templateDefinitions_fr.xml). If no file is found under this name, use default file.
Field Summary
protected static  Log log    Commons Logging instance. 
public static final  String DEFINITIONS_CONFIG_PARAMETER_NAME    Config file parameter name. 
public static final  String PARSER_DETAILS_PARAMETER_NAME    Config file parameter name. 
public static final  String PARSER_VALIDATE_PARAMETER_NAME    Config file parameter name. 
public static final  String[] DEFAULT_DEFINITION_FILENAMES    Possible definition filenames. 
public static final  String FILENAME_EXTENSION    Default filenames extension. 
protected  DefinitionsFactory defaultFactory    Default factory. 
protected transient  XmlParser xmlParser    XML parser used. Attribute is transient to allow serialization. In this implementaiton, xmlParser is created each time we need it ;-(. 
protected  boolean isValidatingParser    Do we want validating parser. Default is false. Can be set from servlet config file. 
protected  int parserDetailLevel    Parser detail level. Default is 0. Can be set from servlet config file. 
Fields inherited from org.apache.struts.tiles.xmlDefinition.FactorySet:
factories
Constructor:
 public I18nFactorySet() 
 public I18nFactorySet(ServletContext servletContext,
    Map properties) throws DefinitionsFactoryException 
    Constructor. Init the factory by reading appropriate configuration file.
    Parameters:
    servletContext - Servlet context.
    properties - Map containing all properties.
    Throws:
    FactoryNotFoundException - Can't find factory configuration file.
Method from org.apache.struts.tiles.xmlDefinition.I18nFactorySet Summary:
createDefaultFactory,   createFactory,   getDefaultFactory,   getDefinitionsFactoryKey,   initFactory,   initFactory,   toString
Methods from org.apache.struts.tiles.xmlDefinition.FactorySet:
createFactory,   getDefaultFactory,   getDefinition,   getDefinitionsFactoryKey,   getFactory,   initFactory,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts.tiles.xmlDefinition.I18nFactorySet Detail:
 protected DefinitionsFactory createDefaultFactory(ServletContext servletContext) throws DefinitionsFactoryException, FileNotFoundException 
    Create default factory . Create InstancesMapper for specified Locale. If creation failes, use default mapper and log error message.
 protected DefinitionsFactory createFactory(Object key,
    ServletRequest request,
    ServletContext servletContext) throws DefinitionsFactoryException 
    Create a factory for specified key. If creation failes, return default factory and log an error message.
 protected DefinitionsFactory getDefaultFactory() 
    Get default factory.
 protected Object getDefinitionsFactoryKey(String name,
    ServletRequest request,
    ServletContext servletContext) 
    Extract key that will be used to get the sub factory.
 public  void initFactory(ServletContext servletContext,
    Map properties) throws DefinitionsFactoryException 
    Initialization method. Init the factory by reading appropriate configuration file. This method is called exactly once immediately after factory creation in case of internal creation (by DefinitionUtil).
 protected  void initFactory(ServletContext servletContext,
    String proposedFilename) throws DefinitionsFactoryException, FileNotFoundException 
    Initialization method. Init the factory by reading appropriate configuration file. This method is called exactly once immediately after factory creation in case of internal creation (by DefinitionUtil).
 public String toString() 
    Return String representation.