public final class PropertyManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PROPERTY_READER_TOKEN
Token which specifies the default property reader
|
static String |
READER_PROPERTY_NAME
Property reader list property name
|
Modifier and Type | Method and Description |
---|---|
static void |
addPropertyListener(PropertyListener listener)
Add a property listener.
|
static void |
addPropertyListeners(PropertyListener[] listeners)
Add an array of property listeners.
|
static boolean |
containsProperty(String name)
Check if this map contains a given property.
|
static String[] |
getArrayProperty(String name)
Get an array style property.
|
static String[] |
getArrayProperty(String base,
String[] defaultValues)
Get an array style property.
|
static PropertyMap |
getDefaultPropertyMap()
Get the default PropertyMap.
|
static String |
getProperty(String name)
Get a property.
|
static String |
getProperty(String name,
String defaultValue)
Get a property.
|
static PropertyGroup |
getPropertyGroup(String basename)
Get a property group for the given property base.
|
static PropertyGroup |
getPropertyGroup(String basename,
int index)
Get a property group for the given property base at the given index.
|
static void |
load(Map map)
Load properties from a map.
|
static void |
load(PropertyReader reader)
Load properties from a PropertyReader.
|
static void |
load(String classname)
Load properties from a PropertyReader specifed by the
given class name.
|
static void |
load(String prefix,
Map map)
Load properties from a map.
|
static Iterator |
names()
Return an iterator over all contained property names.
|
static String |
removeProperty(String name)
Remove a property.
|
static boolean |
removePropertyListener(PropertyListener listener)
Remove a property listener.
|
static String |
setProperty(String name,
String value)
Set a property.
|
public static final String READER_PROPERTY_NAME
public static final String DEFAULT_PROPERTY_READER_TOKEN
public static PropertyMap getDefaultPropertyMap()
public static void addPropertyListener(PropertyListener listener)
listener
- Property listener to add.public static void addPropertyListeners(PropertyListener[] listeners)
listeners
- Array of property listeners to add.public static boolean removePropertyListener(PropertyListener listener)
listener
- Property listener to remove.public static void load(String prefix, Map map) throws PropertyException
prefix
- Prefix to append to all map keys (or null).map
- Map containing properties to load.PropertyException
public static void load(Map map) throws PropertyException, IOException
map
- Map containing properties to load.PropertyException
IOException
public static void load(PropertyReader reader) throws PropertyException, IOException
reader
- PropertyReader to read properties from.PropertyException
IOException
public static void load(String classname) throws PropertyException, IOException
classname
- Class name of a PropertyReader to
read from.PropertyException
IOException
public static String setProperty(String name, String value)
name
- Property name.value
- Property value.public static String removeProperty(String name)
name
- Property name.public static String getProperty(String name, String defaultValue)
name
- Property name.defaultValue
- Default property value.public static String getProperty(String name)
name
- Property name.public static String[] getArrayProperty(String base, String[] defaultValues)
base
- Base property name.defaultValues
- Default property values.public static String[] getArrayProperty(String name)
name
- Property name.public static Iterator names()
public static boolean containsProperty(String name)
name
- Property name.public static PropertyGroup getPropertyGroup(String basename)
basename
- Base property name.public static PropertyGroup getPropertyGroup(String basename, int index)
basename
- Base property name.index
- Array property index.Copyright © 2018 JBoss by Red Hat. All rights reserved.