Java Doc for RBManager.java in  » Internationalization-Localization » RBManager » com » ibm » rbm » 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 » Internationalization Localization » RBManager » com.ibm.rbm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.rbm.RBManager

RBManager
public class RBManager (Code)
A utility class to aid in the process of updating the Natural Language Support of Tempus Fugit. This class scans the directory containing NLS files and checks the various languages found there for completeness, duplication of entry, and status of translation. The class can be instantiated through a constructor, or it can be run from the command line. For additional information on the command line results, see the main method.
author:
   Jared Jackson
See Also:   com.ibm.rbm.RBManager



Constructor Summary
public  RBManager(String baseClassName)
     This constructor creates an entirely blank RBManager and base Bundle.
public  RBManager(File mainFile)
     This is the standard constructor for RBManager.

Method Summary
public  booleancreateGroup(String groupName, String groupComment)
     Attempts to create a new group in each of the language files.
public  booleancreateItem(String name, String value, String groupName, String comment, Hashtable lookups)
     Attempts to create a new item in each of the language files.
public  booleancreateResource(String title, String comment, String manager, String encoding, String language, String country, String variant, boolean copyValues)
     Attempts to create a new resource file with the given encoding.
public  voiddeleteGroup(String groupName)
     Removes a group and all of the items within that group from the various Resource Bundles known to the system.
public  voiddeleteItem(String itemName)
     Remove resource items of the given name from each of the resource bundles that the system knows about.
public  booleaneditItem(BundleItem item, String name, String value, String groupName, String comment, Hashtable lookups)
     Given a BundleItem and some properties to change for that item, this method first checks to make sure the passed item is valid and if it is, the properties of that item are changed to reflect those passed in as parameters to this method.
public  voideraseFile(String encoding)
     Erases permanently one of the resource files.
public  StringgetBaseClass()
     Returns the base class name or null if it does not exist.
public  FilegetBaseFile()
     Returns the name of the file that is the base class file for the resource bundle.
public  BundlegetBundle(String locale)
    
public  VectorgetBundles()
    
public  StringgetDuplicatesListing()
    
public  VectorgetDuplicatesListingVector()
    
public  StringgetGroupListing()
     A useful debugging method that lists the various BundleGroup names in a String.
public  VectorgetGroupListingVector()
     Returns a vector collection of all of the BundleGroup items founds int the bundle.
public  StringgetLanguageListing()
    
public  VectorgetLanguageListingVector()
    
public  intgetNumberDuplicates()
    
public  intgetNumberGroups()
     Returns the number of BundleGroups in the bundle.
public  intgetNumberLanguages()
    
public  intgetNumberTotalTranslations()
    
public  StringgetUser()
    
public  booleanhasResource(String encoding)
     Looks through the resources contained in the bundle for a resource of the given encoding.
public  voidhideResource(String encoding)
     Calling this method removes a resource from the resource bundle.
public static  voidmain(String args)
    
public  voidsetBaseClass(String baseClassName)
    
public  voidsetFileDirectory(File directory)
     Sets the directory in the file system in which this resource bundle is to be saved and retrieved.
public  voidsetUser(String user)
    
public  StringtoSring()
     Returns the base class name if known, or "Unknown Base Class" otherwise.
public  StringtoString()
    
public  voidwriteToFile()
    
public  voidwriteToFile(String encoding)
     Writes only one of the resource files to the file system.


Constructor Detail
RBManager
public RBManager(String baseClassName)(Code)
This constructor creates an entirely blank RBManager and base Bundle. Only the base class name is defined. All other properties need to be defined.



RBManager
public RBManager(File mainFile) throws FileNotFoundException, IOException(Code)
This is the standard constructor for RBManager. It is constructed from the root of a resource bundle. In the current implementation, each file is parsed separately starting with the base class file (root). In this implementation, the lookup keys are represented to the user as they appear in the files. The translation values however are translated according to the basic rules defined in java.util.Properties. Thus in the key, the user may see '\"' when in the value it would have been converted to '"'. This translation is reversed when saving the resource bundle.
Parameters:
  mainFile - The base class file of the resource bundle to be read




Method Detail
createGroup
public boolean createGroup(String groupName, String groupComment)(Code)
Attempts to create a new group in each of the language files. The method first checks the base Resource Bundle to make sure that the group name does not all ready exist. If it does exist the group is not created.
Parameters:
  groupName - The unique group name to be created
Parameters:
  groupComment - An optional comment to be added to the group, can be null An error response. If the creation was successful true is returned, if there was an error false is returned.



createItem
public boolean createItem(String name, String value, String groupName, String comment, Hashtable lookups)(Code)
Attempts to create a new item in each of the language files. The method first checks the base Resource Bundle to make sure that the item name does not all ready exist. If it does exist the item is not created.
Parameters:
  name - The unique key of the item
Parameters:
  value - The translation of the item for the base class
Parameters:
  groupName - The group name, should all ready exist in the base class
Parameters:
  comment - An optional comment to be added to the item, can be null An error response. If the creation was successful true is returned, if there was an error false is returned.



createResource
public boolean createResource(String title, String comment, String manager, String encoding, String language, String country, String variant, boolean copyValues)(Code)
Attempts to create a new resource file with the given encoding. The method first checks the base Resource Bundle to make sure that encoding does not all ready exist. If it does exist the resource file is not created.
Parameters:
  title - An optional, quick title for the file, can be null
Parameters:
  comment - An optional comment to be added to the resource, can be null
Parameters:
  manager - The name of the person responsible for this resource, can be null
Parameters:
  encoding - The proper encoding for the resource. Must be of form 'language', 'language_country', or 'language_country_variant'
Parameters:
  language - A more formal name for the language (e.g. 'English', 'Deutsch', etc.), can be null
Parameters:
  country - A more formal name for the country described by the resource, can be null
Parameters:
  variant - A more formal name for the variant described by the resource, can be null
Parameters:
  copyValues - An indication of wether or not to populate the resource with the items in the base class An error response. If the creation was successful true is returned, if there was an error false is returned.



deleteGroup
public void deleteGroup(String groupName)(Code)
Removes a group and all of the items within that group from the various Resource Bundles known to the system. This method removes the group from the protected vector of groups, then removes all items in that group from the protected vector of untranslated items, and the protected hashtable of all items.



deleteItem
public void deleteItem(String itemName)(Code)
Remove resource items of the given name from each of the resource bundles that the system knows about. This works by first removing the item from the protected vector of translated items, if it is there, and then removing it from the the hashtable of all items, and then removing it from its respective group.



editItem
public boolean editItem(BundleItem item, String name, String value, String groupName, String comment, Hashtable lookups)(Code)
Given a BundleItem and some properties to change for that item, this method first checks to make sure the passed item is valid and if it is, the properties of that item are changed to reflect those passed in as parameters to this method. true if the BundleItem was valid and updateable, false if otherwise (in this case no changes were made).



eraseFile
public void eraseFile(String encoding) throws IOException(Code)
Erases permanently one of the resource files. Be careful about calling this method there is nothing you can do once a file is erased.



getBaseClass
public String getBaseClass()(Code)
Returns the base class name or null if it does not exist.



getBaseFile
public File getBaseFile()(Code)
Returns the name of the file that is the base class file for the resource bundle.



getBundle
public Bundle getBundle(String locale)(Code)
Return a bundle from a locale The requested resource bundle



getBundles
public Vector getBundles()(Code)
A Vector of NLSbundles, one for each language



getDuplicatesListing
public String getDuplicatesListing()(Code)
Returns a single string with a comma delimited listing of all duplicate entries found in the NLS resources



getDuplicatesListingVector
public Vector getDuplicatesListingVector()(Code)
Returns a Vector collection of duplicate BundleItems found in the bundle



getGroupListing
public String getGroupListing()(Code)
A useful debugging method that lists the various BundleGroup names in a String.



getGroupListingVector
public Vector getGroupListingVector()(Code)
Returns a vector collection of all of the BundleGroup items founds int the bundle.



getLanguageListing
public String getLanguageListing()(Code)
Returns a single string comprised of a comma delimited listing of all languages the system seems to support



getLanguageListingVector
public Vector getLanguageListingVector()(Code)
Returns a vector of strings comprising a list of all languages in the system



getNumberDuplicates
public int getNumberDuplicates()(Code)
Returns the number of duplicate NLS entries



getNumberGroups
public int getNumberGroups()(Code)
Returns the number of BundleGroups in the bundle.



getNumberLanguages
public int getNumberLanguages()(Code)
Returns the total number of languages that the system seems to support



getNumberTotalTranslations
public int getNumberTotalTranslations()(Code)
Returns the number of translations contained across all language files



getUser
public String getUser()(Code)
Returns the name of the user currently using the editor



hasResource
public boolean hasResource(String encoding)(Code)
Looks through the resources contained in the bundle for a resource of the given encoding. Note that this search is case sensitive. True if the encoding exists as one of the resource files, false otherwise



hideResource
public void hideResource(String encoding)(Code)
Calling this method removes a resource from the resource bundle. This method does not permanently erase the file containing the resources at this encoding, however any changes or saves that take place once this file has been removed will not be reflected in this hidden file. To restore the resource, the bundle will have to be recreated. (This last point may change)



main
public static void main(String args)(Code)
Main



setBaseClass
public void setBaseClass(String baseClassName)(Code)
Sets the name of the base class associated with this resource bundle



setFileDirectory
public void setFileDirectory(File directory)(Code)
Sets the directory in the file system in which this resource bundle is to be saved and retrieved.



setUser
public void setUser(String user)(Code)
Sets the name of the user currently using the editor



toSring
public String toSring()(Code)
Returns the base class name if known, or "Unknown Base Class" otherwise.



toString
public String toString()(Code)



writeToFile
public void writeToFile() throws IOException(Code)
Write the contents of the file to the output stream



writeToFile
public void writeToFile(String encoding) throws IOException(Code)
Writes only one of the resource files to the file system. This file is specified by the encoding parameter



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.