net.sourceforge.sqlunit.beans
Class Param

java.lang.Object
  extended by net.sourceforge.sqlunit.beans.Param

public class Param
extends java.lang.Object

The Param bean models an Object whose member variables are the attributes of the param element.

Version:
$Revision: 1.6 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
Param()
          Default constructor.
 
Method Summary
 java.lang.String getId()
          Returns the param id.
 java.lang.String getInOut()
          Returns the param in-out value.
 java.lang.String getIsNull()
          Returns true if the param contains null values.
 java.lang.String getName()
          Returns the param name.
 int getScale()
          Returns the scale of the parameter value.
 int getSQLType()
          Convenience method to return the SQL (numeric) type from the supplied (String XML) type.
 java.lang.String getType()
          Returns the param type.
 java.lang.String getTypeName()
          Return the type name of a user-defined type.
 java.lang.String getValue()
          Returns the param value.
 boolean isInParameter()
          Returns true if the parameter is an IN or INOUT parameter.
 boolean isNull()
          Convenience method to return if the parameter is set to NULL.
 boolean isOutParameter()
          Returns true if the parameter is an OUT or INOUT parameter.
 void setId(java.lang.String id)
          Sets the param id.
 void setInOut(java.lang.String inOut)
          Sets the param in-out value.
 void setIsNull(java.lang.String isNull)
          Sets to "true" if the param supports null values.
 void setName(java.lang.String name)
          Sets the param name.
 void setScale(int scale)
          Overloaded convenience setter to set the scale as an int.
 void setScale(java.lang.String scale)
          Sets the scale of the parameter.
 void setType(java.lang.String type)
          Sets the param type.
 void setTypeName(java.lang.String typeName)
          Set the type name of the user-defined type.
 void setValue(java.lang.String value)
          Sets the param value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Param

public Param()
Default constructor.

Method Detail

getId

public final java.lang.String getId()
Returns the param id.

Returns:
the param id.

setId

public final void setId(java.lang.String id)
Sets the param id.

Parameters:
id - the param id.

getName

public final java.lang.String getName()
Returns the param name.

Returns:
the param name.

setName

public final void setName(java.lang.String name)
Sets the param name.

Parameters:
name - the param name.

getType

public final java.lang.String getType()
Returns the param type.

Returns:
the param type.

getSQLType

public final int getSQLType()
                     throws SQLUnitException
Convenience method to return the SQL (numeric) type from the supplied (String XML) type.

Returns:
the SQL Type for this parameter.
Throws:
SQLUnitException - if one is thrown.

setType

public final void setType(java.lang.String type)
Sets the param type.

Parameters:
type - the param type.

getIsNull

public final java.lang.String getIsNull()
Returns true if the param contains null values.

Returns:
"true" if the param contains null values.

isNull

public final boolean isNull()
Convenience method to return if the parameter is set to NULL.

Returns:
true if the parameter is NULL.

setIsNull

public final void setIsNull(java.lang.String isNull)
Sets to "true" if the param supports null values.

Parameters:
isNull - true if the param supports null values.

getInOut

public final java.lang.String getInOut()
Returns the param in-out value.

Returns:
the param in-out value.

isInParameter

public final boolean isInParameter()
Returns true if the parameter is an IN or INOUT parameter.

Returns:
true or false.

isOutParameter

public final boolean isOutParameter()
Returns true if the parameter is an OUT or INOUT parameter.

Returns:
true or false.

setInOut

public final void setInOut(java.lang.String inOut)
Sets the param in-out value.

Parameters:
inOut - the param in-out value.

getValue

public final java.lang.String getValue()
Returns the param value.

Returns:
the param value.

setValue

public final void setValue(java.lang.String value)
Sets the param value.

Parameters:
value - the param value.

getScale

public final int getScale()
Returns the scale of the parameter value. This value is used by SQLUnit only if the type of the parameter maps to a BigDecimalType eg, NUMERIC and DECIMAL types. If this value is not supplied, SQLUnit will try to guess it based on the number of digits after the decimal point in the value.

Returns:
the scale of this parameter, if applicable.

setScale

public final void setScale(java.lang.String scale)
Sets the scale of the parameter. The scale is applicable only if the parameter maps to a BigDecimalType.

Parameters:
scale - the scale of the parameter as a String.

setScale

public final void setScale(int scale)
Overloaded convenience setter to set the scale as an int. The scale is applicable only if the parameter maps to a BigDecimalType.

Parameters:
scale - the scale of the parameter as an int.

getTypeName

public final java.lang.String getTypeName()
Return the type name of a user-defined type. If the data type of the Param object is a user-defined type (REF, STRUCT, DISTINCT, JAVA_OBJECT, or named array type), then this information is used by SQLUnit.

Returns:
the type name of the parameter, if applicable.

setTypeName

public final void setTypeName(java.lang.String typeName)
Set the type name of the user-defined type.

Parameters:
typeName - the fully qualified SQL type name of the Param.