public class PropertiesUtil extends Object
| Constructor and Description |
|---|
PropertiesUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBooleanProperty(Properties properties,
String propertyKey) |
static <T extends Enum<T>> |
getEnumProperty(Properties properties,
String propertyKey,
Class<T> enumType) |
static Properties |
getProperties(String classpathName) |
static String |
getStringProperty(Properties properties,
String propertyKey) |
static void |
loadProperties(String classpathName,
Properties toProps)
loads a properties file from classpath using default classloader
|
public static String getStringProperty(Properties properties, String propertyKey)
JaversException - UNDEFINED_PROPERTYpublic static boolean getBooleanProperty(Properties properties, String propertyKey)
JaversException - UNDEFINED_PROPERTYpublic static <T extends Enum<T>> T getEnumProperty(Properties properties, String propertyKey, Class<T> enumType)
JaversException - UNDEFINED_PROPERTYJaversException - MALFORMED_PROPERTYpublic static Properties getProperties(String classpathName)
public static void loadProperties(String classpathName, Properties toProps)
classpathName - classpath resource nameJaversException - CLASSPATH_RESOURCE_NOT_FOUNDClassLoader.getResourceAsStream(String)Copyright © 2014. All rights reserved.