|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecterland.util.ParameterStorageString
public class ParameterStorageString
Get, set or delete parameters stored in a file
Constructor Summary | |
---|---|
ParameterStorageString(StorageInterface primaryStorage,
StorageInterface secondaryStorage)
Createa a storage object |
|
ParameterStorageString(StorageInterface primaryStorage,
StorageInterface secondaryStorage,
String documentName)
Creates a storage object |
Method Summary | |
---|---|
protected XMLNode |
addChild(XMLNode parent,
String name,
String value)
Add a child XMLNode object to the specified parent, the value of the child object will be parsed to a child tree if it contains XML |
protected XMLNode |
addChildAsStorage(XMLNode parent,
String name,
StorageInterface value)
Add a child XMLNode object to the specified parent, the value of the child object is a StorageInterface object and will be parsed to a child tree if it contains XML |
void |
delParameter(String name)
Delete a parameter |
protected void |
delSpecialParameterInData(XMLNode data,
String name)
Delets a parameter in the XMLNode tree specified, this method is only called if isSpecialHandled(String) returns true |
protected StorageInterface |
getNodeAsStorage(XMLNode node,
String name)
Return the specified node as a storage. |
String |
getParameter(String name)
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 |
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 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 isSpecialHandled(String) returns true |
protected void |
init(StorageInterface primaryStorage,
StorageInterface secondaryStorage,
String documentName)
Initialize this object |
protected boolean |
isSpecialHandled(String name)
Check if this parameter should be special handled, will be autmatically called when a parameter is accessed. |
protected void |
setNodeAsStorage(XMLNode node,
String name,
StorageInterface value)
Set the specified node as a storage. |
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 |
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 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 isSpecialHandled(String) returns true |
protected void |
setValue(XMLNode node,
String value)
Sets the value of a XMLNode object, the value will be parsed to a child tree if it contains XML |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ParameterStorageString(StorageInterface primaryStorage, StorageInterface secondaryStorage)
primaryStorage
- The storage object which the parameters should be read/write from/tosecondaryStorage
- The storage object which the parameters should be read from if they don't exist in the primaryStoragepublic ParameterStorageString(StorageInterface primaryStorage, StorageInterface secondaryStorage, String documentName)
primaryStorage
- The storage object which the parameters should be read/write from/tosecondaryStorage
- The storage object which the parameters should be read from if they don't exist in the primaryStoragedocumentName
- The name of the section in the storage where parameters
are storedMethod Detail |
---|
protected void init(StorageInterface primaryStorage, StorageInterface secondaryStorage, String documentName)
primaryStorage
- The storage object which the parameters should be read/write from/tosecondaryStorage
- The storage object which the parameters should be read from if they don't exist in the primaryStoragedocumentName
- The name of the section in the file where parameters
are storedprotected boolean isSpecialHandled(String name)
name
- The parameter name
true - This parameter should be special handled,then one ofgetSpecialParameterInData(erland.util.XMLNode,String)
,setSpecialParameterInData(erland.util.XMLNode,String,String)
,delSpecialParameterInData(erland.util.XMLNode,String)
, will be called to access the parameter
false - This parameter is handled in the normal way, one ofgetParameter(String)
,setParameter(String,String)
,delParameter(String)
, will be called to access the parameter
protected String getSpecialParameterInData(XMLNode data, String name)
isSpecialHandled(String)
returns true
data
- The XMLNode tree to search for the parameter inname
- The parameter name of the parameter
protected StorageInterface getSpecialParameterAsStorageInData(XMLNode data, String name)
isSpecialHandled(String)
returns true
data
- The XMLNode tree to search for the parameter inname
- The parameter name of the parameter
public String getParameter(String name)
ParameterValueStorageInterface
getParameter
in interface ParameterValueStorageInterface
name
- The name of the parameter
protected void setSpecialParameterInData(XMLNode data, String name, String value)
isSpecialHandled(String)
returns true
data
- The XMLNode tree to set the parameter inname
- The parameter name of the parametervalue
- The parameter value of the parameterprotected void setSpecialParameterAsStorageInData(XMLNode data, String name, StorageInterface value)
isSpecialHandled(String)
returns true
The value is specified as a StorageInterface object
data
- The XMLNode tree to set the parameter inname
- The parameter name of the parametervalue
- The parameter value of the parameterpublic void setParameter(String name, String value)
ParameterValueStorageInterface
setParameter
in interface ParameterValueStorageInterface
name
- The name of the parametervalue
- The value of the parameterprotected XMLNode addChild(XMLNode parent, String name, String value)
parent
- The parent XMLNode objectname
- The name of the child objectvalue
- The value of the child object
protected XMLNode addChildAsStorage(XMLNode parent, String name, StorageInterface value)
parent
- The parent XMLNode objectname
- The name of the child objectvalue
- The value of the child object
protected void setValue(XMLNode node, String value)
node
- The XMLNode object to set value onvalue
- The value to setprotected void delSpecialParameterInData(XMLNode data, String name)
isSpecialHandled(String)
returns true
data
- The XMLNode tree to set the parameter inname
- The parameter name of the parameterpublic void delParameter(String name)
ParameterValueStorageInterface
delParameter
in interface ParameterValueStorageInterface
name
- The name of the parameterpublic String toString()
toString
in class Object
public StorageInterface getParameterAsStorage(String name)
ParameterValueStorageExInterface
getParameterAsStorage
in interface ParameterValueStorageExInterface
name
- The name of the parameter to retreive
protected StorageInterface getNodeAsStorage(XMLNode node, String name)
node
- The node that matched the parameter namename
- The parameter name that was searched for
protected void setNodeAsStorage(XMLNode node, String name, StorageInterface value)
node
- The node that matched the parameter namename
- The parameter name that was searched forvalue
- The value as a StorageInterface objectpublic void setParameterAsStorage(String name, StorageInterface value)
ParameterValueStorageExInterface
ParameterValueStorageExInterface.getParameterAsStorage(String)
method
setParameterAsStorage
in interface ParameterValueStorageExInterface
name
- The name of the parameter to setvalue
- The value as a StorageInterface object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |