Package org.zaval.io

Examples of org.zaval.io.PropertiesFile


   }


    private Properties filterProperties(Properties p, String prefix) {
        prefix = prefix + TranslatorConstants.KEY_SEPARATOR;
        Properties result = new PropertiesFile();
        Iterator i = p.entrySet().iterator();
        while (i.hasNext()) {
            Map.Entry prop = (Map.Entry) i.next();
            String name = (String) prop.getKey();
            if (!name.startsWith(prefix))
                continue;
            name = name.substring(prefix.length());
            if (name.indexOf(TranslatorConstants.KEY_SEPARATOR) != -1)
                continue;           
            String value = (String) prop.getValue();
            if (value == null || value.trim().length() == 0)
                continue;
            result.setProperty(name, value);
        }
        return result;
    }
View Full Code Here


   
    public Properties getProperties(String lng) {
        return getProperties(lng, null);
    }
    public Properties getProperties(String lng, BundleSet defaultTranslations) {
        Properties p = new PropertiesFile();
        Iterator i = items.values().iterator();
        while (i.hasNext()) {
       BundleItem bi = (BundleItem) i.next();
           String value = bi.getTranslation(lng);
           if (value!=null && value.trim().length() != 0 &&
               !isDefaultValue(bi, defaultTranslations, lng)) {
               String key = bi.getId();
               key = maybeAddBrokenSuffix(key, value);
               p.setProperty(key, value);
           }
        }
        return p;
    }
View Full Code Here

TOP

Related Classes of org.zaval.io.PropertiesFile

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.