public class I18nFactorySet extends FactorySet
templateDefinitions_fr.xml). If no file is found under this name, use default file.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String[] |
DEFAULT_DEFINITION_FILENAMES
Possible definition filenames.
|
protected DefinitionsFactory |
defaultFactory
Default factory.
|
static java.lang.String |
DEFINITIONS_CONFIG_PARAMETER_NAME
Config file parameter name.
|
static java.lang.String |
FILENAME_EXTENSION
Default filenames extension.
|
protected boolean |
isValidatingParser
Do we want validating parser.
|
protected static org.apache.commons.logging.Log |
log
Commons Logging instance.
|
static java.lang.String |
PARSER_DETAILS_PARAMETER_NAME
Config file parameter name.
|
static java.lang.String |
PARSER_VALIDATE_PARAMETER_NAME
Config file parameter name.
|
protected int |
parserDetailLevel
Parser detail level.
|
protected XmlParser |
xmlParser
XML parser used.
|
factories| Constructor and Description |
|---|
I18nFactorySet()
Parameterless Constructor.
|
I18nFactorySet(javax.servlet.ServletContext servletContext,
java.util.Map properties)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected DefinitionsFactory |
createDefaultFactory(javax.servlet.ServletContext servletContext)
Create default factory .
|
protected DefinitionsFactory |
createFactory(java.lang.Object key,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Create a factory for specified key.
|
protected DefinitionsFactory |
getDefaultFactory()
Get default factory.
|
protected java.lang.Object |
getDefinitionsFactoryKey(java.lang.String name,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Extract key that will be used to get the sub factory.
|
void |
initFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
Initialization method.
|
protected void |
initFactory(javax.servlet.ServletContext servletContext,
java.lang.String proposedFilename)
Initialization method.
|
protected XmlDefinitionsSet |
parseXmlFile(javax.servlet.ServletContext servletContext,
java.lang.String filename,
XmlDefinitionsSet xmlDefinitions)
Parse specified xml file and add definition to specified definitions set.
|
protected XmlDefinitionsSet |
parseXmlFiles(javax.servlet.ServletContext servletContext,
java.lang.String postfix,
XmlDefinitionsSet xmlDefinitions)
Parse files associated to postix if they exist.
|
java.lang.String |
toString()
Return String representation.
|
getDefinition, getFactoryprotected static org.apache.commons.logging.Log log
public static final java.lang.String DEFINITIONS_CONFIG_PARAMETER_NAME
public static final java.lang.String PARSER_DETAILS_PARAMETER_NAME
public static final java.lang.String PARSER_VALIDATE_PARAMETER_NAME
public static final java.lang.String[] DEFAULT_DEFINITION_FILENAMES
public static final java.lang.String FILENAME_EXTENSION
protected DefinitionsFactory defaultFactory
protected transient XmlParser xmlParser
protected boolean isValidatingParser
false.
Can be set from servlet config file.protected int parserDetailLevel
public I18nFactorySet()
initFactory(javax.servlet.ServletContext, java.util.Map) must be called prior to any use of created factory.public I18nFactorySet(javax.servlet.ServletContext servletContext,
java.util.Map properties)
throws DefinitionsFactoryException
servletContext - Servlet context.properties - Map containing all properties.FactoryNotFoundException - Can't find factory configuration file.DefinitionsFactoryExceptionpublic void initFactory(javax.servlet.ServletContext servletContext,
java.util.Map properties)
throws DefinitionsFactoryException
initFactory in interface ComponentDefinitionsFactoryinitFactory in class FactorySetservletContext - Servlet Context passed to newly created factory.properties - Map of name/property passed to newly created factory. Map can contains
more properties than requested.DefinitionsFactoryException - An error occur during initialization.protected void initFactory(javax.servlet.ServletContext servletContext,
java.lang.String proposedFilename)
throws DefinitionsFactoryException,
java.io.FileNotFoundException
servletContext - Servlet Context passed to newly created factory.proposedFilename - File names, comma separated, to use as base file names.DefinitionsFactoryException - An error occur during initialization.java.io.FileNotFoundExceptionprotected DefinitionsFactory getDefaultFactory()
getDefaultFactory in class FactorySetprotected DefinitionsFactory createDefaultFactory(javax.servlet.ServletContext servletContext) throws DefinitionsFactoryException, java.io.FileNotFoundException
servletContext - Current servlet context. Used to open file.DefinitionsFactoryException - If an error occur while creating factory.java.io.FileNotFoundException - if factory can't be loaded from filenames.protected java.lang.Object getDefinitionsFactoryKey(java.lang.String name,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
getDefinitionsFactoryKey in class FactorySetname - Name of requested definitionrequest - Current servlet request.servletContext - Current servlet context.null if not found.protected DefinitionsFactory createFactory(java.lang.Object key, javax.servlet.ServletRequest request, javax.servlet.ServletContext servletContext) throws DefinitionsFactoryException
createFactory in class FactorySetkey - The key.request - Servlet request.servletContext - Servlet context.DefinitionsFactoryException - If an error occur while creating factory.protected XmlDefinitionsSet parseXmlFiles(javax.servlet.ServletContext servletContext, java.lang.String postfix, XmlDefinitionsSet xmlDefinitions) throws DefinitionsFactoryException
null.postfix - Postfix to add to each description file.xmlDefinitions - Definitions set to which definitions will be added. If null, a definitions
set is created on request.DefinitionsFactoryException - On errors parsing file.protected XmlDefinitionsSet parseXmlFile(javax.servlet.ServletContext servletContext, java.lang.String filename, XmlDefinitionsSet xmlDefinitions) throws DefinitionsFactoryException
null, create a new set. Otherwise, return
passed definition set (can be null).servletContext - Current servlet context. Used to open file.filename - Name of file to parse.xmlDefinitions - Definitions set to which definitions will be added. If null, a definitions
set is created on request.DefinitionsFactoryException - On errors parsing file.public java.lang.String toString()
toString in class FactorySetCopyright © 2000–2025 Apache Software Foundation. All rights reserved.