src/main/java/org/jboss/util/property/PropertyMap.java
public String[] getArrayProperty(String base, String[] defaultValues)
   {
      if (base == null)
         throw new NullArgumentException("base");

      // create a new list to store indexed values into
      List list = new LinkedList();

      int i = 0;
      while (true)
      {
         // make the index property name
         String name = makeIndexPropertyName(base, i);

         // see if there is a value for this property
         String value = getProperty(name);

         if (value != null)
         {
            list.add(value);
         }
         else if (i >= 0)
         {
            break; // no more index properties
         }

         i++;
      }

      String values[] = defaultValues;

      // if the list is not empty, then return it as an array
      if (list.size() != 0)
      {
         values = (String[]) list.toArray(new String[list.size()]);
      }

      return values;
   }
public String[] getArrayProperty(String base, String[] defaultValues)
   {
      if (base == null)
         throw new NullArgumentException("base");

      // create a new list to store indexed values into
      List list = new LinkedList();

      int i = 0;
      while (true)
      {
         // make the index property name
         String name = makeIndexPropertyName(base, i);

         // see if there is a value for this property
         String value = getProperty(name);

         if (value != null)
         {
            list.add(value);
         }
         else if (i >= 0)
         {
            break; // no more index properties
         }

         i++;
      }

      String values[] = defaultValues;

      // if the list is not empty, then return it as an array
      if (list.size() != 0)
      {
         values = (String[]) list.toArray(new String[list.size()]);
      }

      return values;
   }
public String [ ] getArrayProperty ( String base , String [ ] defaultValues ) { if ( base == null ) throw new NullArgumentException ( "base" ) ; // create a new list to store indexed values into List list = new LinkedList ( ) ; int i = 0 ; while ( true ) { // make the index property name String name = makeIndexPropertyName ( base , i ) ; // see if there is a value for this property String value = getProperty ( name ) ; if ( value != null ) { list . add ( value ) ; } else if ( i >= 0 ) { break ; // no more index properties } i ++ ; } String values [ ] = defaultValues ; // if the list is not empty, then return it as an array if ( list . size ( ) != 0 ) { values = ( String [ ] ) list . toArray ( new String [ list . size ( ) ] ) ; } return values ; }
Get an array style property.

<p>Array properties are specified as:
<code>base_property_name.<b>INDEX</b>.

<p>Indexes begin with zero and must be contiguous.  A break in
continuity signals the end of the array.

@param base          Base property name.
@param defaultValues Default property values.
@return              Array of property values or default.
Get an array style property .