Java Doc for CharSetMap.java in  » Web-Framework » TURBINE » org » apache » turbine » services » mimetype » util » 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 » TURBINE » org.apache.turbine.services.mimetype.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.turbine.services.mimetype.util.CharSetMap

CharSetMap
public class CharSetMap (Code)
This class maintains a set of mappers defining mappings between locales and the corresponding charsets. The mappings are defined as properties between locale and charset names. The definitions can be listed in property files located in user's home directory, Java home directory or the current class jar. In addition, this class maintains static default mappings and constructors support application specific mappings.
author:
   Ilkka Priha
version:
   $Id: CharSetMap.java 534527 2007-05-02 16:10:59Z tv $


Field Summary
final public static  StringCHARSET_RESOURCE
     The name for charset mapper resources.
final public static  StringDEFAULT_CHARSET
     The default charset when nothing else is applicable.

Constructor Summary
public  CharSetMap()
     Constructs a new charset map with default mappers.
public  CharSetMap(Properties props)
     Contructs a charset map from properties.
public  CharSetMap(InputStream input)
     Contructs a charset map read from a stream.
public  CharSetMap(File file)
     Contructs a charset map read from a property file.
public  CharSetMap(String path)
     Contructs a charset map read from a property file path.

Method Summary
public  StringgetCharSet(Locale locale)
     Gets the charset for a locale.
public  StringgetCharSet(Locale locale, String variant)
     Gets the charset for a locale with a variant.
public  StringgetCharSet(String key)
     Gets the charset for a specified key.
Parameters:
  key - the key for the charset.
public  StringgetCharSet(String key, String def)
     Gets the charset for a specified key.
Parameters:
  key - the key for the charset.
Parameters:
  def - the default charset if none is found.
protected static  MaploadFile(File file)
     Loads mappings from a file.
Parameters:
  file - a file.
protected static  MaploadPath(String path)
     Loads mappings from a file path.
Parameters:
  path - a file path.
protected static  MaploadResource(String name)
     Loads mappings from a resource.
Parameters:
  name - a resource name.
protected static  MaploadStream(InputStream input)
     Loads mappings from a stream.
Parameters:
  input - an input stream.
public synchronized  voidsetCharSet(String key, String charset)
     Sets a locale-charset mapping.
protected synchronized  voidsetCommonCharSet(String key, String charset)
     Sets a common locale-charset mapping.

Field Detail
CHARSET_RESOURCE
final public static String CHARSET_RESOURCE(Code)
The name for charset mapper resources.



DEFAULT_CHARSET
final public static String DEFAULT_CHARSET(Code)
The default charset when nothing else is applicable.




Constructor Detail
CharSetMap
public CharSetMap()(Code)
Constructs a new charset map with default mappers.



CharSetMap
public CharSetMap(Properties props)(Code)
Contructs a charset map from properties.
Parameters:
  props - charset mapping propeties.



CharSetMap
public CharSetMap(InputStream input) throws IOException(Code)
Contructs a charset map read from a stream.
Parameters:
  input - an input stream.
throws:
  IOException - for an incorrect stream.



CharSetMap
public CharSetMap(File file) throws IOException(Code)
Contructs a charset map read from a property file.
Parameters:
  file - a property file.
throws:
  IOException - for an incorrect property file.



CharSetMap
public CharSetMap(String path) throws IOException(Code)
Contructs a charset map read from a property file path.
Parameters:
  path - a property file path.
throws:
  IOException - for an incorrect property file.




Method Detail
getCharSet
public String getCharSet(Locale locale)(Code)
Gets the charset for a locale. First a locale specific charset is searched for, then a country specific one and lastly a language specific one. If none is found, the default charset is returned.
Parameters:
  locale - the locale. the charset.



getCharSet
public String getCharSet(Locale locale, String variant)(Code)
Gets the charset for a locale with a variant. The search is performed in the following order: "lang"_"country"_"variant"="charset", _"counry"_"variant"="charset", "lang"__"variant"="charset", __"variant"="charset", "lang"_"country"="charset", _"country"="charset", "lang"="charset". If nothing of the above is found, the default charset is returned.
Parameters:
  locale - the locale.
Parameters:
  variant - a variant field. the charset.



getCharSet
public String getCharSet(String key)(Code)
Gets the charset for a specified key.
Parameters:
  key - the key for the charset. the found charset or the default one.



getCharSet
public String getCharSet(String key, String def)(Code)
Gets the charset for a specified key.
Parameters:
  key - the key for the charset.
Parameters:
  def - the default charset if none is found. the found charset or the given default.



loadFile
protected static Map loadFile(File file) throws IOException(Code)
Loads mappings from a file.
Parameters:
  file - a file. the mappings.
throws:
  IOException - for an incorrect file.



loadPath
protected static Map loadPath(String path) throws IOException(Code)
Loads mappings from a file path.
Parameters:
  path - a file path. the mappings.
throws:
  IOException - for an incorrect file.



loadResource
protected static Map loadResource(String name)(Code)
Loads mappings from a resource.
Parameters:
  name - a resource name. the mappings.



loadStream
protected static Map loadStream(InputStream input) throws IOException(Code)
Loads mappings from a stream.
Parameters:
  input - an input stream. the mappings.
throws:
  IOException - for an incorrect stream.



setCharSet
public synchronized void setCharSet(String key, String charset)(Code)
Sets a locale-charset mapping.
Parameters:
  key - the key for the charset.
Parameters:
  charset - the corresponding charset.



setCommonCharSet
protected synchronized void setCommonCharSet(String key, String charset)(Code)
Sets a common locale-charset mapping.
Parameters:
  key - the key for the charset.
Parameters:
  charset - the corresponding charset.



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.