Changeset 5108


Ignore:
Timestamp:
2003-08-07T16:24:39+12:00 (21 years ago)
Author:
kjdon
Message:

gadually standardising my Java code. have turned all class variables from like raw_ to this.raw

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/util/Dictionary.java

    r3577 r5108  
    88
    99    /** The locale of this dictionary. */
    10     protected Locale locale_ = null;
     10    protected Locale locale = null;
    1111   
    1212    /** The resource that has been loaded */
    13     protected String resource_ = null;
     13    protected String resource = null;
    1414
    1515    /** The ResourceBundle which contains the raw key-value mappings. Loaded from a file named "resource_locale.properties*/
    16     private ResourceBundle raw_ = null;
     16    private ResourceBundle raw = null;
    1717
    1818    /**  Constructs the Dictionary class by first checking if a Locale has been set. If not the default locale is used, and a ResourceBundle is created. Finally a single important String, Language, is made available outside the class so a more read-able version of the Locale of this Dictionary is present.
     
    2222    // Initialize.
    2323   
    24     locale_ = new Locale(lang);
    25     resource_ = resource;
    26     if (locale_ == null) {
    27         locale_ = Locale.getDefault();
     24    this.locale = new Locale(lang);
     25    this.resource = resource;
     26    if (this.locale == null) {
     27        this.locale = Locale.getDefault();
    2828    }
    2929    try {
    30         raw_ = ResourceBundle.getBundle(resource_, locale_);
     30        this.raw = ResourceBundle.getBundle(this.resource, this.locale);
    3131    } catch (Exception e) {
    32         System.err.println("Dictionary: couldn't locate a resource bundle. Error message: "+e.getMessage());
     32        System.err.println("Dictionary: couldn't locate a resource bundle for "+resource);
    3333    }
    3434    }
    3535
    3636    public Enumeration getKeys() {
    37     if (raw_ != null) {
    38         return raw_.getKeys();
     37    if (this.raw != null) {
     38        return this.raw.getKeys();
    3939    }
    4040    return null;
     
    5555     */
    5656    public String get(String key, String args[]) {
    57     if (raw_ == null) {
     57    if (this.raw == null) {
    5858        return null;
    5959    }
    6060    try {
    61         String initial = raw_.getString(key);
     61        String initial = this.raw.getString(key);
    6262        // If the string contains arguments we have to insert them.
    6363        String complete = "";
     
    8585    }
    8686    catch (Exception e) {
    87         System.err.println("Exception: " + e.toString());
    88         e.printStackTrace();
     87        System.err.println("Dictionary Error: couldn't find string for key:" + key +" in resource "+this.resource);
    8988        return null;
    9089    }
Note: See TracChangeset for help on using the changeset viewer.