Code example for ResourceBundle

Methods: getString

0
        } 
    } 
 
    private static String fname(String[] args) {
        if (args.length == 0) {
            System.err.println(rb.getString("missing"));
            System.err.println(rb.getString("usage"));
            System.exit(2);
        } 
        if (args.length > 1) {
            System.err.println(rb.getString("too-many"));
            System.err.println(rb.getString("usage"));
            System.exit(2);
        } 
        String arg0 = args[0];
        if (arg0.equals("-h") || arg0.equals("--help")) {
            System.out.println(rb.getString("usage"));
            System.exit(0);
        } 
        if (arg0.equals("-V") || arg0.equals("--version")) {
            Package p = Xml2HL7.class.getPackage();
            String s = p.getName();
            System.out.println(s.substring(s.lastIndexOf('.')+1) + ": " +
                   p.getImplementationVersion());
            System.exit(0);
        } 
        if (arg0.startsWith("-") && arg0.length() > 1) {
            System.err.println(MessageFormat.format(
                    rb.getString("unrecognized-option"), arg0));
            System.err.println(rb.getString("usage"));
            System.exit(2);
        } 
        return arg0;
    } 
}