org.jboss.util.property
Class Property

java.lang.Object
  extended by org.jboss.util.property.Property

public final class Property
extends Object

Provides shorter method names for working with the PropertyManager.

Version:
$Revision: 1.1.28.2 $
Author:
Jason Dillon, Adrian Brock

Field Summary
static String FILE_SEPARATOR
          Platform dependant file separator.
static String LINE_SEPARATOR
          Platform dependent line separator.
static String PATH_SEPARATOR
          Platform dependant path separator.
 
Constructor Summary
Property()
           
 
Method Summary
static void addListener(PropertyListener listener)
          Add a property listener
static void addListeners(PropertyListener[] listeners)
          Add an array of property listeners
static boolean exists(String name)
          Check if a property of the given name exists.
static String get(String name)
          Get a property
static String get(String name, String defaultValue)
          Get a property
static String[] getArray(String name)
          Get an array style property
static String[] getArray(String base, String[] defaultValues)
          Get an array style property
static PropertyGroup getGroup(String basename)
          Get a property group for the given property base
static PropertyGroup getGroup(String basename, int index)
          Get a property group for the given property base at the given index
static String remove(String name)
          Remove a property
static boolean removeListener(PropertyListener listener)
          Remove a property listener
static String set(String name, String value)
          Set a property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static String LINE_SEPARATOR
Platform dependent line separator.


FILE_SEPARATOR

public static String FILE_SEPARATOR
Platform dependant file separator.


PATH_SEPARATOR

public static String PATH_SEPARATOR
Platform dependant path separator.

Constructor Detail

Property

public Property()
Method Detail

addListener

public static void addListener(PropertyListener listener)
Add a property listener

Parameters:
listener - Property listener to add

addListeners

public static void addListeners(PropertyListener[] listeners)
Add an array of property listeners

Parameters:
listeners - Array of property listeners to add

removeListener

public static boolean removeListener(PropertyListener listener)
Remove a property listener

Parameters:
listener - Property listener to remove
Returns:
True if listener was removed

set

public static String set(String name,
                         String value)
Set a property

Parameters:
name - Property name
value - Property value
Returns:
Previous property value or null

remove

public static String remove(String name)
Remove a property

Parameters:
name - Property name
Returns:
Removed property value or null

get

public static String get(String name,
                         String defaultValue)
Get a property

Parameters:
name - Property name
defaultValue - Default property value
Returns:
Property value or default

get

public static String get(String name)
Get a property

Parameters:
name - Property name
Returns:
Property value or null

getArray

public static String[] getArray(String base,
                                String[] defaultValues)
Get an array style property

Parameters:
base - Base property name
defaultValues - Default property values
Returns:
Array of property values or default

getArray

public static String[] getArray(String name)
Get an array style property

Parameters:
name - Property name
Returns:
Array of property values or empty array

exists

public static boolean exists(String name)
Check if a property of the given name exists.

Parameters:
name - Property name
Returns:
True if property exists

getGroup

public static PropertyGroup getGroup(String basename)
Get a property group for the given property base

Parameters:
basename - Base property name
Returns:
Property group

getGroup

public static PropertyGroup getGroup(String basename,
                                     int index)
Get a property group for the given property base at the given index

Parameters:
basename - Base property name
index - Array property index
Returns:
Property group


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.