Package java.util

Examples of java.util.PropertyResourceBundle


              .trim();
          String bundleVariable = attrValue.substring(2, i).trim();
          if (BUNDLE_MAP == null) {
            return attrValue;
          }
          PropertyResourceBundle bundle = (PropertyResourceBundle) BUNDLE_MAP
              .get(bundleVariable);

          if (bundle != null) {
            try {
              value = bundle.getString(key);
              if (value != null) {
                return value;
              }
                            return attrValue;
            } catch (MissingResourceException e1) {
View Full Code Here


            /*
        File fileProperties = new File(test2);

        FileInputStream fis = new FileInputStream(fileProperties);
        */
        PropertyResourceBundle prb = new PropertyResourceBundle(s);
        s.close();
       
        //PropertyResourceBundle prb = (PropertyResourceBundle)ResourceBundle.getBundle("Model.properties");
       
       
View Full Code Here

            /*
            File fileProperties = new File(test2);

            FileInputStream fis = new FileInputStream(fileProperties);
            */
            PropertyResourceBundle prb = new PropertyResourceBundle(s);
            s.close();

            // PropertyResourceBundle prb =
            // (PropertyResourceBundle)ResourceBundle.getBundle("Model.properties");

View Full Code Here

            /*
            File fileProperties = new File(test2);

            FileInputStream fis = new FileInputStream(fileProperties);
            */
            PropertyResourceBundle prb = new PropertyResourceBundle(s);
            s.close();

            // PropertyResourceBundle prb =
            // (PropertyResourceBundle)ResourceBundle.getBundle("Model.properties");

View Full Code Here

            /*
            File fileProperties = new File(test2);

            FileInputStream fis = new FileInputStream(fileProperties);
            */
            PropertyResourceBundle prb = new PropertyResourceBundle(s);
            s.close();

            // PropertyResourceBundle prb =
            // (PropertyResourceBundle)ResourceBundle.getBundle("Model.properties");

View Full Code Here

        /* Loading short and long class name used */

        InputStream s = null;
        s = ConfigAsXmlHelper.class.getResourceAsStream("Model.properties");
        try {
            PropertyResourceBundle prb = new PropertyResourceBundle(s);
            s.close();
            converterData.setClassFullName(prb);
        }
        catch (Exception exc) {
            String errorMessage = "Cannot read Model.properties " + exc.getMessage();
View Full Code Here

                    return;
                }
            } else {
                // Try to read from specified properties file
                try {
                    config = new PropertyResourceBundle(
                            new FileInputStream(configOverride));
                } catch (IOException e) {
                    throw new ChainedRuntimeException(
                        "Cannot read cactus configuration file ["
                        + configOverride + "]", e);
View Full Code Here

    private PropertyResourceBundle getRAS(String res) throws Exception {
        InputStream ras = this.getClass().getResourceAsStream(res);
        if (ras == null){
            return null;
        }
        return new PropertyResourceBundle(ras);
    }
View Full Code Here

            if (resourcePrefix.endsWith(MESSAGES)) {
                messagePRB = defaultPRB;
            }
        } else if (checkUnexpected) {
            // Check all the keys are in the default props file
            PropertyResourceBundle prb = getRAS(res);
            if (prb == null){
                return;
            }
            final ArrayList<String> list = Collections.list(prb.getKeys());
            Collections.sort(list);
            final boolean mainResourceFile = resname.startsWith("messages");
            for (String key : list) {
                try {
                    String val = defaultPRB.getString(key); // Also Check key is in default
                    if (mainResourceFile && val.equals(prb.getString(key))){
                        System.out.println("Duplicate value? "+key+"="+val+" in "+res);
                        subTestFailures++;
                    }
                } catch (MissingResourceException e) {
                    subTestFailures++;
View Full Code Here

                        // for this component is successful, the ResourceBundle is wrapped in a Map<String, String> and
                        // returned.
                        try
                        {
                            _resourceBundleMap
                                    = new BundleMap(new PropertyResourceBundle(bundleResource.getInputStream()));
                        }
                        catch (IOException e1)
                        {
                            // Nothing happens, then resourceBundleMap is set as empty map
                        }
View Full Code Here

TOP

Related Classes of java.util.PropertyResourceBundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.