org.objectledge.parameters.directory
Class DirectoryParameters

java.lang.Object
  extended by org.objectledge.parameters.DefaultParameters
      extended by org.objectledge.parameters.directory.DirectoryParameters
All Implemented Interfaces:
Parameters

public class DirectoryParameters
extends DefaultParameters

Parameters implementation based on directory context.

Version:
$Id: DirectoryParameters.java,v 1.6 2005/07/22 17:19:41 pablo Exp $
Author:
Pawel Potempski

Field Summary
private  DirContext ctx
          the context
 
Fields inherited from class org.objectledge.parameters.DefaultParameters
map, TRUE
 
Constructor Summary
DirectoryParameters(DirContext ctx)
          Create a new container.
 
Method Summary
 void add(Parameters parameters, boolean overwrite)
          Adds all parameters from another container to this container. If overwrite is set to true all conflicting parameters from this container will be replaced, otherwise all parameters from another container will be added.
 void add(String name, String value)
          Add the parameter.
 void add(String name, String[] values)
          Add the parameter.
 String get(String name)
          Return the parameter with specified name.
 String get(String name, String defaultValue)
          Return the parameter with specified name.
 Parameters getChild(String prefix)
          Return a parameters object that represents a subset of parameters with specified prefix.
 String[] getParameterNames()
          Return the names of all parameters.
 String[] getStrings(String name)
          Return all values of the parameter with specified name as an array.
 boolean isDefined(String name)
          Checks whether parameter is defined.
 void remove()
          Remove all parameters.
 void remove(Set keys)
          Remove all parameters with a name contained in given set.
 void remove(String name)
          Remove all parameters with a specified name.
 void remove(String name, String value)
          Remove all parameters with a specified name and string value.
 void removeExcept(Set keys)
          Remove all except those with a keys specified in the set.
 void set(String name, boolean[] values)
          Set the parameter.
 void set(String name, float[] values)
          Set the parameter.
 void set(String name, int[] values)
          Set the parameter.
 void set(String name, long[] values)
          Set the parameter.
 void set(String name, String value)
          Set the parameter.
 void set(String name, String[] values)
          Set the parameter.
 String toString()
          Returns the contained properties as a parsable String.
 
Methods inherited from class org.objectledge.parameters.DefaultParameters
add, add, add, add, add, add, add, add, add, add, getBoolean, getBoolean, getBooleans, getDate, getDate, getDates, getFloat, getFloat, getFloats, getInt, getInt, getInts, getLong, getLong, getLongs, getSingleValue, remove, remove, remove, remove, set, set, set, set, set, set, set, setupMap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ctx

private DirContext ctx
the context

Constructor Detail

DirectoryParameters

public DirectoryParameters(DirContext ctx)
Create a new container.

Parameters:
ctx - the underlying directory context.
Method Detail

get

public String get(String name)
Return the parameter with specified name.

Specified by:
get in interface Parameters
Overrides:
get in class DefaultParameters
Parameters:
name - the name of the parameter.
Returns:
the string value of the parameter.

get

public String get(String name,
                  String defaultValue)
Return the parameter with specified name.

Specified by:
get in interface Parameters
Overrides:
get in class DefaultParameters
Parameters:
name - the name of the parameter.
defaultValue - the default value of the parameter.
Returns:
the string value of the parameter.

getStrings

public String[] getStrings(String name)
Return all values of the parameter with specified name as an array.

Specified by:
getStrings in interface Parameters
Overrides:
getStrings in class DefaultParameters
Parameters:
name - the name of the parameters.
Returns:
the array of the string values of the parameter.

getParameterNames

public String[] getParameterNames()
Return the names of all parameters.

Specified by:
getParameterNames in interface Parameters
Overrides:
getParameterNames in class DefaultParameters
Returns:
the parameter names.

isDefined

public boolean isDefined(String name)
Checks whether parameter is defined.

Specified by:
isDefined in interface Parameters
Overrides:
isDefined in class DefaultParameters
Parameters:
name - the name of the parameter.
Returns:
true if parameter is defined.

remove

public void remove()
Remove all parameters.

Specified by:
remove in interface Parameters
Overrides:
remove in class DefaultParameters

remove

public void remove(String name)
Remove all parameters with a specified name.

Specified by:
remove in interface Parameters
Overrides:
remove in class DefaultParameters
Parameters:
name - the parameter name.

remove

public void remove(String name,
                   String value)
Remove all parameters with a specified name and string value.

Specified by:
remove in interface Parameters
Overrides:
remove in class DefaultParameters
Parameters:
name - the parameter name.
value - the parameter value.

remove

public void remove(Set keys)
Remove all parameters with a name contained in given set.

Specified by:
remove in interface Parameters
Overrides:
remove in class DefaultParameters
Parameters:
keys - the set of keys.

removeExcept

public void removeExcept(Set keys)
Remove all except those with a keys specified in the set.

Specified by:
removeExcept in interface Parameters
Overrides:
removeExcept in class DefaultParameters
Parameters:
keys - the set of names.

set

public void set(String name,
                String value)
Set the parameter.

Specified by:
set in interface Parameters
Overrides:
set in class DefaultParameters
Parameters:
name - the parameter name.
value - the parameter value.

set

public void set(String name,
                String[] values)
Set the parameter.

Specified by:
set in interface Parameters
Overrides:
set in class DefaultParameters
Parameters:
name - the parameter name.
values - the parameter values.

set

public void set(String name,
                boolean[] values)
Set the parameter.

Specified by:
set in interface Parameters
Overrides:
set in class DefaultParameters
Parameters:
name - the parameter name.
values - the parameter values.

set

public void set(String name,
                float[] values)
Set the parameter.

Specified by:
set in interface Parameters
Overrides:
set in class DefaultParameters
Parameters:
name - the parameter name.
values - the parameter values.

set

public void set(String name,
                int[] values)
Set the parameter.

Specified by:
set in interface Parameters
Overrides:
set in class DefaultParameters
Parameters:
name - the parameter name.
values - the parameter values.

set

public void set(String name,
                long[] values)
Set the parameter.

Specified by:
set in interface Parameters
Overrides:
set in class DefaultParameters
Parameters:
name - the parameter name.
values - the parameter values.

add

public void add(String name,
                String value)
Add the parameter.

Specified by:
add in interface Parameters
Overrides:
add in class DefaultParameters
Parameters:
name - the parameter name.
value - the parameter value.

add

public void add(String name,
                String[] values)
Add the parameter.

Specified by:
add in interface Parameters
Overrides:
add in class DefaultParameters
Parameters:
name - the parameter name.
values - the parameter values.

add

public void add(Parameters parameters,
                boolean overwrite)
Adds all parameters from another container to this container. If overwrite is set to true all conflicting parameters from this container will be replaced, otherwise all parameters from another container will be added.

Specified by:
add in interface Parameters
Overrides:
add in class DefaultParameters
Parameters:
parameters - the parameters object.
overwrite - the overwrite switch.

toString

public String toString()
Returns the contained properties as a parsable String.

Specified by:
toString in interface Parameters
Overrides:
toString in class DefaultParameters
Returns:
parsable String representation of the contained properties.

getChild

public Parameters getChild(String prefix)
Return a parameters object that represents a subset of parameters with specified prefix.

Specified by:
getChild in interface Parameters
Overrides:
getChild in class DefaultParameters
Parameters:
prefix - the prefix.
Returns:
the nested parameters object.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.