Java Doc for I18nFactorySet.java in  » Web-Framework » struts-1.3.8 » org » apache » struts » tiles » xmlDefinition » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » struts 1.3.8 » org.apache.struts.tiles.xmlDefinition 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.struts.tiles.xmlDefinition.FactorySet
      org.apache.struts.tiles.xmlDefinition.I18nFactorySet

All known Subclasses:   org.apache.struts.tiles.CustomI18nFactorySet,
I18nFactorySet
public class I18nFactorySet extends FactorySet (Code)
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
final public static  StringDEFAULT_DEFINITION_FILENAMES
     Possible definition filenames.
final public static  StringDEFINITIONS_CONFIG_PARAMETER_NAME
     Config file parameter name.
final public static  StringFILENAME_EXTENSION
     Default filenames extension.
final public static  StringPARSER_DETAILS_PARAMETER_NAME
     Config file parameter name.
final public static  StringPARSER_VALIDATE_PARAMETER_NAME
     Config file parameter name.
protected  DefinitionsFactorydefaultFactory
     Default factory.
protected  booleanisValidatingParser
     Do we want validating parser.
protected static  Loglog
     Commons Logging instance.
protected  intparserDetailLevel
     Parser detail level.
protected transient  XmlParserxmlParser
     XML parser used. Attribute is transient to allow serialization.

Constructor Summary
public  I18nFactorySet()
     Parameterless Constructor.
public  I18nFactorySet(ServletContext servletContext, Map properties)
     Constructor.

Method Summary
protected  DefinitionsFactorycreateDefaultFactory(ServletContext servletContext)
     Create default factory . Create InstancesMapper for specified Locale. If creation failes, use default mapper and log error message.
Parameters:
  servletContext - Current servlet context.
protected  DefinitionsFactorycreateFactory(Object key, ServletRequest request, ServletContext servletContext)
     Create a factory for specified key. If creation failes, return default factory and log an error message.
Parameters:
  key - The key.
Parameters:
  request - Servlet request.
Parameters:
  servletContext - Servlet context.
protected  DefinitionsFactorygetDefaultFactory()
     Get default factory.
protected  ObjectgetDefinitionsFactoryKey(String name, ServletRequest request, ServletContext servletContext)
     Extract key that will be used to get the sub factory.
Parameters:
  name - Name of requested definition
Parameters:
  request - Current servlet request.
Parameters:
  servletContext - Current servlet context.
public  voidinitFactory(ServletContext servletContext, Map properties)
     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).
Parameters:
  servletContext - Servlet Context passed to newly created factory.
Parameters:
  properties - Map of name/property passed to newly created factory.
protected  voidinitFactory(ServletContext servletContext, String proposedFilename)
     Initialization method.
protected  XmlDefinitionsSetparseXmlFile(ServletContext servletContext, String filename, XmlDefinitionsSet xmlDefinitions)
     Parse specified xml file and add definition to specified definitions set. This method is used to load several description files in one instances list. If filename exists and definition set is null, create a new set.
protected  XmlDefinitionsSetparseXmlFiles(ServletContext servletContext, String postfix, XmlDefinitionsSet xmlDefinitions)
     Parse files associated to postix if they exist. For each name in filenames, append postfix before file extension, then try to load the corresponding file. If file doesn't exist, try next one.
public  StringtoString()
     Return String representation.

Field Detail
DEFAULT_DEFINITION_FILENAMES
final public static String DEFAULT_DEFINITION_FILENAMES(Code)
Possible definition filenames.



DEFINITIONS_CONFIG_PARAMETER_NAME
final public static String DEFINITIONS_CONFIG_PARAMETER_NAME(Code)
Config file parameter name.



FILENAME_EXTENSION
final public static String FILENAME_EXTENSION(Code)
Default filenames extension.



PARSER_DETAILS_PARAMETER_NAME
final public static String PARSER_DETAILS_PARAMETER_NAME(Code)
Config file parameter name.



PARSER_VALIDATE_PARAMETER_NAME
final public static String PARSER_VALIDATE_PARAMETER_NAME(Code)
Config file parameter name.



defaultFactory
protected DefinitionsFactory defaultFactory(Code)
Default factory.



isValidatingParser
protected boolean isValidatingParser(Code)
Do we want validating parser. Default is false. Can be set from servlet config file.



log
protected static Log log(Code)
Commons Logging instance.



parserDetailLevel
protected int parserDetailLevel(Code)
Parser detail level. Default is 0. Can be set from servlet config file.



xmlParser
protected transient XmlParser xmlParser(Code)
XML parser used. Attribute is transient to allow serialization. In this implementaiton, xmlParser is created each time we need it ;-(.




Constructor Detail
I18nFactorySet
public I18nFactorySet()(Code)
Parameterless Constructor. Method I18nFactorySet.initFactory must be called prior to any use of created factory.



I18nFactorySet
public I18nFactorySet(ServletContext servletContext, Map properties) throws DefinitionsFactoryException(Code)
Constructor. Init the factory by reading appropriate configuration file.
Parameters:
  servletContext - Servlet context.
Parameters:
  properties - Map containing all properties.
throws:
  FactoryNotFoundException - Can't find factory configuration file.




Method Detail
createDefaultFactory
protected DefinitionsFactory createDefaultFactory(ServletContext servletContext) throws DefinitionsFactoryException, FileNotFoundException(Code)
Create default factory . Create InstancesMapper for specified Locale. If creation failes, use default mapper and log error message.
Parameters:
  servletContext - Current servlet context. Used to open file. Created default definition factory.
throws:
  DefinitionsFactoryException - If an error occur while creating factory.
throws:
  FileNotFoundException - if factory can't be loaded from filenames.



createFactory
protected DefinitionsFactory createFactory(Object key, ServletRequest request, ServletContext servletContext) throws DefinitionsFactoryException(Code)
Create a factory for specified key. If creation failes, return default factory and log an error message.
Parameters:
  key - The key.
Parameters:
  request - Servlet request.
Parameters:
  servletContext - Servlet context. Definition factory for specified key.
throws:
  DefinitionsFactoryException - If an error occur while creating factory.



getDefaultFactory
protected DefinitionsFactory getDefaultFactory()(Code)
Get default factory. Default factory



getDefinitionsFactoryKey
protected Object getDefinitionsFactoryKey(String name, ServletRequest request, ServletContext servletContext)(Code)
Extract key that will be used to get the sub factory.
Parameters:
  name - Name of requested definition
Parameters:
  request - Current servlet request.
Parameters:
  servletContext - Current servlet context. the key or null if not found.



initFactory
public void initFactory(ServletContext servletContext, Map properties) throws DefinitionsFactoryException(Code)
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).
Parameters:
  servletContext - Servlet Context passed to newly created factory.
Parameters:
  properties - Map of name/property passed to newly created factory. Map can containsmore properties than requested.
throws:
  DefinitionsFactoryException - An error occur during initialization.



initFactory
protected void initFactory(ServletContext servletContext, String proposedFilename) throws DefinitionsFactoryException, FileNotFoundException(Code)
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).
Parameters:
  servletContext - Servlet Context passed to newly created factory.
Parameters:
  proposedFilename - File names, comma separated, to use as base file names.
throws:
  DefinitionsFactoryException - An error occur during initialization.



parseXmlFile
protected XmlDefinitionsSet parseXmlFile(ServletContext servletContext, String filename, XmlDefinitionsSet xmlDefinitions) throws DefinitionsFactoryException(Code)
Parse specified xml file and add definition to specified definitions set. This method is used to load several description files in one instances list. If filename exists and definition set is null, create a new set. Otherwise, return passed definition set (can be null).
Parameters:
  servletContext - Current servlet context. Used to open file.
Parameters:
  filename - Name of file to parse.
Parameters:
  xmlDefinitions - Definitions set to which definitions will be added. If null, a definitionsset is created on request. XmlDefinitionsSet The definitions set created or passed as parameter.
throws:
  DefinitionsFactoryException - On errors parsing file.



parseXmlFiles
protected XmlDefinitionsSet parseXmlFiles(ServletContext servletContext, String postfix, XmlDefinitionsSet xmlDefinitions) throws DefinitionsFactoryException(Code)
Parse files associated to postix if they exist. For each name in filenames, append postfix before file extension, then try to load the corresponding file. If file doesn't exist, try next one. Each file description is added to the XmlDefinitionsSet description. The XmlDefinitionsSet description is created only if there is a definition file. Inheritance is not resolved in the returned XmlDefinitionsSet. If no description file can be opened and no definiion set is provided, return null.
Parameters:
  postfix - Postfix to add to each description file.
Parameters:
  xmlDefinitions - Definitions set to which definitions will be added. If null, a definitionsset is created on request. XmlDefinitionsSet The definitions set created or passed as parameter.
throws:
  DefinitionsFactoryException - On errors parsing file.



toString
public String toString()(Code)
Return String representation. String representation.



Fields inherited from org.apache.struts.tiles.xmlDefinition.FactorySet
protected Map factories(Code)(Java Doc)

Methods inherited from org.apache.struts.tiles.xmlDefinition.FactorySet
abstract protected DefinitionsFactory createFactory(Object key, ServletRequest request, ServletContext servletContext) throws DefinitionsFactoryException(Code)(Java Doc)
abstract protected DefinitionsFactory getDefaultFactory()(Code)(Java Doc)
public ComponentDefinition getDefinition(String name, ServletRequest request, ServletContext servletContext) throws NoSuchDefinitionException, DefinitionsFactoryException(Code)(Java Doc)
abstract protected Object getDefinitionsFactoryKey(String name, ServletRequest request, ServletContext servletContext)(Code)(Java Doc)
protected DefinitionsFactory getFactory(Object key, ServletRequest request, ServletContext servletContext) throws DefinitionsFactoryException(Code)(Java Doc)
abstract public void initFactory(ServletContext servletContext, Map properties) throws DefinitionsFactoryException(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.