org.licas.call

## Class ParamInfo

- java.lang.Object
- - org.licas.call.ParamInfo

- Direct Known Subclasses:
    WsdlParamInfo

      public class ParamInfo
      extends java.lang.Object

  This class stores information relating to a single parameter for a method. The parameter value is stored in a ArrayList called `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.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `ParamInfo()` Creates a new instance of ParamInfo
    `ParamInfo(java.lang.Object valueObj)` Creates a new instance of ParamInfo.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### name

          protected java.lang.String name

      Parameter name

    - #### type

          protected java.lang.String type

      Parameter type. Set this before adding a value.

    - #### value

          protected java.lang.Object value

      Parameter value

  - ### Constructor Detail

    - #### ParamInfo

          public ParamInfo()

      Creates a new instance of ParamInfo

    - #### ParamInfo

          public ParamInfo(java.lang.Object valueObj)

      Creates a new instance of ParamInfo.
      Parameters:
        `valueObj` - a value to add to values.

  - ### Method Detail

    - #### setName

          public void setName(java.lang.String theName)

      Set the parameter name.
      Parameters:
        `theName` - the parameter name.

    - #### getName

          public java.lang.String getName()

      Get the parameter name.
      Returns:
        the value of name.

    - #### setType

          public void setType(java.lang.String thisType)

      Set the parameter type. This is normally set when setting the value, but if the value is purposely different, the type can be set here instead.
      Parameters:
        `thisType` - the parameter type.

    - #### getType

          public java.lang.String getType()

      Get the parameter type.
      Returns:
        the value of type.

    - #### resetValue

          public void resetValue()

      Reset value to be `null`.

    - #### setValue

          public void setValue(java.lang.Object thisValue)

      Set the value to the parameter passed in. This also sets the value type to what the value is, or null if the value is null.
      Parameters:
        `thisValue` - the parameter value.

    - #### setValue

          public void setValue(java.lang.Object thisValue,
                               boolean setType)

      Set the value to the parameter passed in. This can also set the value type.
      Parameters:
        `thisValue` - the parameter value.
        `setType` - if true then also set the type.

    - #### setAddValue

          public 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. 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.

      Parameters:
        `thisValue` - the parameter value to set/add.

    - #### getValue

          public java.lang.Object getValue()

      Return the parameter value.
      Returns:
        the value of `value`, which can be `null`.

    - #### toString

          public java.lang.String toString()

      Convert the parameter description to a String.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the parameter description as a String.

    - #### toElement

          public org.licas_xml.abs.Element toElement()
                                              throws java.lang.Exception

      Convert the parameter description to an xml element.
      Returns:
        the parameter description as an xml element.
      Throws:
        `java.lang.Exception` - any error.

    - #### fromElement

          public void fromElement(org.licas_xml.abs.Element rootElem)
                           throws java.lang.Exception

      Set the values in this ParamInfo object from the XML-based description.
      Parameters:
        `rootElem` - the root element with the specific parameter values.
      Throws:
        `java.lang.Exception` - any error.

    - #### clone

          public java.lang.Object clone()

      Return a clone of this object.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        a clone of this object.