erland.util
Class ParameterStorageGroupWithId

java.lang.Object
  extended by erland.util.ParameterStorageString
      extended by erland.util.ParameterStorageStringEx
          extended by erland.util.ParameterStorageGroupWithId
All Implemented Interfaces:
ParameterValueStorageExInterface, ParameterValueStorageInterface

public class ParameterStorageGroupWithId
extends ParameterStorageStringEx

Handles storing of groupdata

Author:
Erland Isaksson

Constructor Summary
ParameterStorageGroupWithId(StorageInterface primaryStorage, StorageInterface secondaryStorage, String documentName, String groupPrefix)
          Creates a new object
 
Method Summary
protected  void delSpecialParameterInData(XMLNode data, String name)
          Delets a parameter in the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true
protected  XMLNode findGroupNode(XMLNode data, String name)
          Find a specific group node in the XMLNode tree
protected  String getId(String name)
           
protected  StorageInterface getSpecialParameterAsStorageInData(XMLNode data, String name)
          Gets a storage object for a parameter from the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true
protected  String getSpecialParameterInData(XMLNode data, String name)
          Gets the parameter value for a parameter from the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true
protected  boolean isSpecialHandled(String name)
          Check if this parameter should be special handled, will be autmatically called when a parameter is accessed.
protected  void setSpecialParameterAsStorageInData(XMLNode data, String name, StorageInterface value)
          Sets the parameter value for a parameter in the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true The value is specified as a StorageInterface object
protected  void setSpecialParameterInData(XMLNode data, String name, String value)
          Sets the parameter value for a parameter in the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true
 
Methods inherited from class erland.util.ParameterStorageStringEx
getNodeAsStorage, setNodeAsStorage
 
Methods inherited from class erland.util.ParameterStorageString
addChild, addChildAsStorage, delParameter, getParameter, getParameterAsStorage, init, setParameter, setParameterAsStorage, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterStorageGroupWithId

public ParameterStorageGroupWithId(StorageInterface primaryStorage,
                                   StorageInterface secondaryStorage,
                                   String documentName,
                                   String groupPrefix)
Creates a new object

Parameters:
primaryStorage - The storage object which the parameters should be read/write from/to
secondaryStorage - The storage object which the parameters should be read from if they don't exist in the primaryStorage
documentName - Name of the document
Method Detail

getSpecialParameterInData

protected String getSpecialParameterInData(XMLNode data,
                                           String name)
Description copied from class: ParameterStorageString
Gets the parameter value for a parameter from the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true

Overrides:
getSpecialParameterInData in class ParameterStorageString
Parameters:
data - The XMLNode tree to search for the parameter in
name - The parameter name of the parameter
Returns:
The value of the parameter

getSpecialParameterAsStorageInData

protected StorageInterface getSpecialParameterAsStorageInData(XMLNode data,
                                                              String name)
Description copied from class: ParameterStorageString
Gets a storage object for a parameter from the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true

Overrides:
getSpecialParameterAsStorageInData in class ParameterStorageString
Parameters:
data - The XMLNode tree to search for the parameter in
name - The parameter name of the parameter
Returns:
The storage object for the parameter

isSpecialHandled

protected boolean isSpecialHandled(String name)
Description copied from class: ParameterStorageString
Check if this parameter should be special handled, will be autmatically called when a parameter is accessed. Implement this in your sub class if you want to handle some parameters in a special way.

Overrides:
isSpecialHandled in class ParameterStorageString
Parameters:
name - The parameter name
Returns:
Always false
true - This parameter should be special handled,then one of 
         ParameterStorageString.getSpecialParameterInData(erland.util.XMLNode,String), ParameterStorageString.setSpecialParameterInData(erland.util.XMLNode,String,String), ParameterStorageString.delSpecialParameterInData(erland.util.XMLNode,String),
         will be called to access the parameter
false - This parameter is handled in the normal way, one of
         ParameterStorageString.getParameter(String), ParameterStorageString.setParameter(String,String), ParameterStorageString.delParameter(String), 
         will be called to access the parameter

setSpecialParameterInData

protected void setSpecialParameterInData(XMLNode data,
                                         String name,
                                         String value)
Description copied from class: ParameterStorageString
Sets the parameter value for a parameter in the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true

Overrides:
setSpecialParameterInData in class ParameterStorageString
Parameters:
data - The XMLNode tree to set the parameter in
name - The parameter name of the parameter
value - The parameter value of the parameter

setSpecialParameterAsStorageInData

protected void setSpecialParameterAsStorageInData(XMLNode data,
                                                  String name,
                                                  StorageInterface value)
Description copied from class: ParameterStorageString
Sets the parameter value for a parameter in the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true The value is specified as a StorageInterface object

Overrides:
setSpecialParameterAsStorageInData in class ParameterStorageString
Parameters:
data - The XMLNode tree to set the parameter in
name - The parameter name of the parameter
value - The parameter value of the parameter

delSpecialParameterInData

protected void delSpecialParameterInData(XMLNode data,
                                         String name)
Description copied from class: ParameterStorageString
Delets a parameter in the XMLNode tree specified, this method is only called if ParameterStorageString.isSpecialHandled(String) returns true

Overrides:
delSpecialParameterInData in class ParameterStorageString
Parameters:
data - The XMLNode tree to set the parameter in
name - The parameter name of the parameter

findGroupNode

protected XMLNode findGroupNode(XMLNode data,
                                String name)
Find a specific group node in the XMLNode tree

Parameters:
data - Main object for the XMLNode tree
name - The group to find
Returns:
The XMLNode object if the group node was found or null if it was not found

getId

protected String getId(String name)


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