erland.util
Class ParameterStorageTree

java.lang.Object
  extended by erland.util.ParameterStorageTree
All Implemented Interfaces:
ParameterValueStorageExInterface, ParameterValueStorageInterface

public class ParameterStorageTree
extends Object
implements ParameterValueStorageExInterface

Get parameters from an XML document

Author:
Erland Isaksson

Constructor Summary
ParameterStorageTree(StorageInterface storage, StorageFactoryInterface subStorageFactory)
          Create an instance which accesses data in the specified storage
 
Method Summary
 void delParameter(String name)
          Delete a parameter
 String getParameter(String str)
          Get a parameter value
 StorageInterface getParameterAsStorage(String name)
          Retreives the parameter as a StorageInterface object instead of a value Observe that this is a new StorageInterface object and will not be related to any of your other StorageInterface objects
 void setParameter(String name, String value)
          Set a parameter value
 void setParameterAsStorage(String name, StorageInterface value)
          Sets the parameter as a StorageInterface object instead of a value Observe that this is a new StorageInterface object must have been retreived with the ParameterValueStorageExInterface.getParameterAsStorage(String) method
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterStorageTree

public ParameterStorageTree(StorageInterface storage,
                            StorageFactoryInterface subStorageFactory)
Create an instance which accesses data in the specified storage

Parameters:
storage - The storage object
subStorageFactory - A storage factory that should be used when creating new sub storages
Method Detail

getParameter

public String getParameter(String str)
Description copied from interface: ParameterValueStorageInterface
Get a parameter value

Specified by:
getParameter in interface ParameterValueStorageInterface
Parameters:
str - The name of the parameter
Returns:
The value of the parameter, will be an empty string if the parameter does not exist

setParameter

public void setParameter(String name,
                         String value)
Description copied from interface: ParameterValueStorageInterface
Set a parameter value

Specified by:
setParameter in interface ParameterValueStorageInterface
Parameters:
name - The name of the parameter
value - The value of the parameter

delParameter

public void delParameter(String name)
Description copied from interface: ParameterValueStorageInterface
Delete a parameter

Specified by:
delParameter in interface ParameterValueStorageInterface
Parameters:
name - The name of the parameter

setParameterAsStorage

public void setParameterAsStorage(String name,
                                  StorageInterface value)
Description copied from interface: ParameterValueStorageExInterface
Sets the parameter as a StorageInterface object instead of a value Observe that this is a new StorageInterface object must have been retreived with the ParameterValueStorageExInterface.getParameterAsStorage(String) method

Specified by:
setParameterAsStorage in interface ParameterValueStorageExInterface
Parameters:
name - The name of the parameter to set
value - The value as a StorageInterface object

getParameterAsStorage

public StorageInterface getParameterAsStorage(String name)
Description copied from interface: ParameterValueStorageExInterface
Retreives the parameter as a StorageInterface object instead of a value Observe that this is a new StorageInterface object and will not be related to any of your other StorageInterface objects

Specified by:
getParameterAsStorage in interface ParameterValueStorageExInterface
Parameters:
name - The name of the parameter to retreive
Returns:
A StorageInterface object containing the value of the parameter

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2005 Erland Isaksson. All Rights Reserved.