29 lines
832 B
Java
29 lines
832 B
Java
|
|
||
|
import java.io.BufferedReader;
|
||
|
import java.util.HashMap;
|
||
|
|
||
|
public class ParameterChecker {
|
||
|
|
||
|
HashMap<String,String[]> map = new HashMap<String,String[]>();
|
||
|
|
||
|
public ParameterChecker(BufferedReader reader) throws Exception {
|
||
|
String s;
|
||
|
while ((s = reader.readLine()) != null) {
|
||
|
String[] tokens = s.split("\\s");
|
||
|
map.put(tokens[0], tokens);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public String[] getChecks(String functionName) {
|
||
|
String[] checks = map.get(functionName);
|
||
|
if (checks == null &&
|
||
|
(functionName.endsWith("fv") ||
|
||
|
functionName.endsWith("xv") ||
|
||
|
functionName.endsWith("iv"))) {
|
||
|
functionName = functionName.substring(0, functionName.length() - 2);
|
||
|
checks = map.get(functionName);
|
||
|
}
|
||
|
return checks;
|
||
|
}
|
||
|
}
|