Class Property


  • public final class Property
    extends java.lang.Object
    Provides shorter method names for working with the PropertyManager.
    Version:
    $Revision$
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FILE_SEPARATOR
      Platform dependant file separator.
      static java.lang.String LINE_SEPARATOR
      Platform dependent line separator.
      static java.lang.String PATH_SEPARATOR
      Platform dependant path separator.
    • Constructor Summary

      Constructors 
      Constructor Description
      Property()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addListener​(PropertyListener listener)
      Add a property listener
      static void addListeners​(PropertyListener[] listeners)
      Add an array of property listeners
      static boolean exists​(java.lang.String name)
      Check if a property of the given name exists.
      static java.lang.String get​(java.lang.String name)
      Get a property
      static java.lang.String get​(java.lang.String name, java.lang.String defaultValue)
      Get a property
      static java.lang.String[] getArray​(java.lang.String name)
      Get an array style property
      static java.lang.String[] getArray​(java.lang.String base, java.lang.String[] defaultValues)
      Get an array style property
      static PropertyGroup getGroup​(java.lang.String basename)
      Get a property group for the given property base
      static PropertyGroup getGroup​(java.lang.String basename, int index)
      Get a property group for the given property base at the given index
      static java.lang.String remove​(java.lang.String name)
      Remove a property
      static boolean removeListener​(PropertyListener listener)
      Remove a property listener
      static java.lang.String set​(java.lang.String name, java.lang.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 java.lang.String LINE_SEPARATOR
        Platform dependent line separator.
      • FILE_SEPARATOR

        public static java.lang.String FILE_SEPARATOR
        Platform dependant file separator.
      • PATH_SEPARATOR

        public static java.lang.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 java.lang.String set​(java.lang.String name,
                                           java.lang.String value)
        Set a property
        Parameters:
        name - Property name
        value - Property value
        Returns:
        Previous property value or null
      • remove

        public static java.lang.String remove​(java.lang.String name)
        Remove a property
        Parameters:
        name - Property name
        Returns:
        Removed property value or null
      • get

        public static java.lang.String get​(java.lang.String name,
                                           java.lang.String defaultValue)
        Get a property
        Parameters:
        name - Property name
        defaultValue - Default property value
        Returns:
        Property value or default
      • get

        public static java.lang.String get​(java.lang.String name)
        Get a property
        Parameters:
        name - Property name
        Returns:
        Property value or null
      • getArray

        public static java.lang.String[] getArray​(java.lang.String base,
                                                  java.lang.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 java.lang.String[] getArray​(java.lang.String name)
        Get an array style property
        Parameters:
        name - Property name
        Returns:
        Array of property values or empty array
      • exists

        public static boolean exists​(java.lang.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​(java.lang.String basename)
        Get a property group for the given property base
        Parameters:
        basename - Base property name
        Returns:
        Property group
      • getGroup

        public static PropertyGroup getGroup​(java.lang.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