Project

General

Profile

« Previous | Next » 

Revision 3673

Added by barteau almost 17 years ago

Changes to the field "skinconfigs":
1) Made it private
2) Created setter and getter methods
3) Created a 'hasSkinConfig' method

View differences:

src/edu/ucsb/nceas/metacat/MetaCatUtil.java
38 38
import java.text.SimpleDateFormat;
39 39
import java.util.HashMap;
40 40
import java.util.Hashtable;
41
import java.util.Properties;
41 42
import java.util.Stack;
42 43
import java.util.Vector;
43 44
import java.util.regex.PatternSyntaxException;
......
59 60

  
60 61
    public static Vector pathsForIndexing;
61 62
    
62
    public static HashMap skinconfigs = new HashMap();
63
    private static HashMap skinconfigs = new HashMap();
63 64

  
64 65
    private static edu.ucsb.nceas.utilities.Options options = null;
65 66

  
......
1050 1051
        return new File(dirname);
1051 1052
    }
1052 1053

  
1054
    /**
1055
     * Adds the Properties and skin to the list of skin configurations.
1056
     * @param skinName String qformat
1057
     * @param skinProperties Properties instance
1058
     */
1059
    public static void addSkinConfig(String skinName, Properties skinProperties) {
1060
        skinconfigs.put(skinName, skinProperties);
1061
    }
1062

  
1063
    /**
1064
     * Return the Properties for a given skin name.
1065
     * @param skinName String qformat
1066
     * @return Properties, or null if none exist for the skin.
1067
     */
1068
    public static Properties getSkinConfig(String skinName) {
1069
        Properties                      result;
1070
        
1071
        result = (Properties) skinconfigs.get(skinName);
1072
        return(result);
1073
    }
1074
    
1075
    /**
1076
     * Returns true if Properties exist for a given skin name, false otherwise.
1077
     * @param skinName String qformat
1078
     * @return boolean
1079
     */
1080
    public static boolean hasSkinConfig(String skinName) {
1081
        boolean                     result;
1082
        
1083
        result = skinconfigs.containsKey(skinName);
1084
        return(result);
1085
    }
1053 1086
}

Also available in: Unified diff