@SuppressWarnings("unchecked") public Enumeration getKeys() { return bundle.getKeys();
/** * Gets the keys contained in the wrapped {@link PropertyResourceBundle}. * * @return the list of key. * @see java.util.ResourceBundle#getKeys() */ public Enumeration<String> getKeys() { return bundle.getKeys(); }
@Override public Enumeration<String> getKeys() { return innerBundle.getKeys(); }
@Override public Enumeration <String> getKeys () { return m_aBundle.getKeys (); }
/** * This method returns an enumerated handle of the keys * which correspond to values translated to various locales. * * @return an enumeration of keys which have messages tranlated to * corresponding locales. */ @SuppressWarnings("rawtypes") public Enumeration getKeys() { return propResBundle.getKeys(); }
@Override @SuppressWarnings("unchecked") public Enumeration getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return bundle.getKeys(); }
@Override public Enumeration<String> getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return bundle.getKeys(); }
public Enumeration getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return bundle.getKeys(); }
public Enumeration<String> getKeys() { return propertyResourceBundle.get().getKeys(); }
public static Enumeration getKeys(String bundleName, Locale locale) { String loc = locale.getLanguage() + "_" + locale.getCountry(); if (isNotBlank(locale.getVariant())) { loc += "_" + locale.getVariant(); } PropertyResourceBundle bundle = getBundle(bundleName, loc); if (bundle == null) { return null; } return bundle.getKeys(); }
@Override public Enumeration<String> getKeys() { if (overridingProps != null) { return new TypedEnumeration<String>(overridingProps.keys()); } return internalBundle.getKeys(); }
public String[] getPropertyStringArray(PropertyResourceBundle bundle, String keyPrefix) { String[] result; Enumeration<String> keys = bundle.getKeys(); ArrayList<String> temp = new ArrayList<String>(); for (Enumeration<String> e = keys; keys.hasMoreElements();) { String key = e.nextElement(); if (key.startsWith(keyPrefix)) { temp.add(key); } } result = new String[temp.size()]; for (int i = 0; i < temp.size(); i++) { result[i] = bundle.getString(temp.get(i)); } return result; }
public class UnicodePropertiesPropertySourceLoader implements PropertySourceLoader { @Override public String[] getFileExtensions() { return new String[]{"properties"}; } @Override public PropertySource<?> load(String name, Resource resource, String profile) throws IOException { if (profile == null) { Properties properties = new Properties(); PropertyResourceBundle bundle = new PropertyResourceBundle(new InputStreamReader(resource.getInputStream(), "UTF-8")); Enumeration<String> keys = bundle.getKeys(); while (keys.hasMoreElements()) { String key = keys.nextElement(); properties.setProperty(key, bundle.getString(key)); } if (!properties.isEmpty()) { return new PropertiesPropertySource(name, properties); } } return null; } }
/** * Load an Ujo from Java resource bundle */ public UJO loadResourceBundle(InputStream inp, boolean validate, Object context) throws IllegalStateException { UJO ujo = null; try { ujo = getUjoClass().newInstance(); PropertyResourceBundle bundle = new PropertyResourceBundle(inp); UjoAction action = new UjoActionImpl(UjoAction.ACTION_RESBUNDLE_IMPORT, context); Enumeration<String> keys = bundle.getKeys(); while (keys.hasMoreElements()) { final String key = keys.nextElement(); final String value = bundle.getString(key); final Key prop = ujo.readKeys().findDirectKey(key, false); if (prop!=null) { setText(ujo, prop, null, value, action); } else if (validate) { throw new IllegalStateException(MsgFormatter.format("The '{}' was not found in '{}',", key, ujo.getClass())); } } } catch (RuntimeException | ReflectiveOperationException | IOException e) { throwsPropFailed(e, context); } return ujo; }