public class ParamInfo
extends java.lang.Object
values
. This can be the
ArrayList list itself, by specifying the parameter type to be a ArrayList. If the
parameter type is something else, then the value object is stored in the first
element of the values list only and only the first element is returned when the
value is requested. Use TypeConst
.VECTOR
to specify a ArrayList value type. If the
value is included in the constructor, new ParamInfo(the_value)
, then it is
stored in the first element of the values list and the type can be set later.
When using as part of a method call, the MethodHandler
checks the parameter type
automatically using the Java instanceof
or getClass()
operators and so the constructor
approach is probably best.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name
Parameter name
|
protected java.lang.String |
type
Parameter type.
|
protected java.lang.Object |
value
Parameter value
|
Constructor and Description |
---|
ParamInfo()
Creates a new instance of ParamInfo
|
ParamInfo(java.lang.Object valueObj)
Creates a new instance of ParamInfo.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Return a clone of this object.
|
void |
fromElement(org.licas_xml.abs.Element rootElem)
Set the values in this ParamInfo object from the XML-based description.
|
java.lang.String |
getName()
Get the parameter name.
|
java.lang.String |
getType()
Get the parameter type.
|
java.lang.Object |
getValue()
Return the parameter value.
|
void |
resetValue()
Reset value to be
null . |
void |
setAddValue(java.lang.Object thisValue)
This sets the parameter value if it is currently
null , or it adds the value
to a ArrayList list if it is not null. |
void |
setName(java.lang.String theName)
Set the parameter name.
|
void |
setType(java.lang.String thisType)
Set the parameter type.
|
void |
setValue(java.lang.Object thisValue)
Set the value to the parameter passed in.
|
void |
setValue(java.lang.Object thisValue,
boolean setType)
Set the value to the parameter passed in.
|
org.licas_xml.abs.Element |
toElement()
Convert the parameter description to an xml element.
|
java.lang.String |
toString()
Convert the parameter description to a String.
|
protected java.lang.String name
protected java.lang.String type
protected java.lang.Object value
public ParamInfo()
public ParamInfo(java.lang.Object valueObj)
valueObj
- a value to add to values.public void setName(java.lang.String theName)
theName
- the parameter name.public java.lang.String getName()
public void setType(java.lang.String thisType)
thisType
- the parameter type.public java.lang.String getType()
public void resetValue()
null
.public void setValue(java.lang.Object thisValue)
thisValue
- the parameter value.public void setValue(java.lang.Object thisValue, boolean setType)
thisValue
- the parameter value.setType
- if true then also set the type.public void setAddValue(java.lang.Object thisValue)
null
, or it adds the value
to a ArrayList
list if it is not null. This method might be used if values
are iteratively added over time, maybe from a GUI interface.
If the current value
is not a ArrayList, a ArrayList is created, the current
value
is added to it and then the new thisValue
. This is then set
as the parameter value object. The parameter type
is not changed by this method.
thisValue
- the parameter value to set/add.public java.lang.Object getValue()
value
, which can be null
.public java.lang.String toString()
toString
in class java.lang.Object
public org.licas_xml.abs.Element toElement() throws java.lang.Exception
java.lang.Exception
- any error.public void fromElement(org.licas_xml.abs.Element rootElem) throws java.lang.Exception
rootElem
- the root element with the specific parameter values.java.lang.Exception
- any error.public java.lang.Object clone()
clone
in class java.lang.Object