net.sourceforge.sqlunit.beans
Class StructBean

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

public class StructBean
extends java.lang.Object

Models a struct element.

Version:
$Revision: 1.1 $
Author:
Douglas Kvidera (dkvidera@users.sourceforge.net) - 05/15/06

Constructor Summary
StructBean()
          No-param constructor.
StructBean(java.lang.Object obj)
          Creates a struct and contained field objects by reading parameter as a JavaBean.
 
Method Summary
 void addField(FieldBean fBean)
          Adds FieldBean to end of contained list
 void addField(int index, FieldBean fBean)
          Adds FieldBean to end of contained list at given index
static void setTypeMap(java.util.Map map)
          Sets a mapping to determine if field is a nested struct.
 org.jdom.Element toElement()
          Returns a JDOM Element representing this Struct object.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StructBean

public StructBean()
No-param constructor.


StructBean

public StructBean(java.lang.Object obj)
Creates a struct and contained field objects by reading parameter as a JavaBean. Properties for static Class getClass() and mandatory String SQLData.getSQLTypeName() are ignored.

Parameters:
obj - Any object; fields will be JavaBean properties.
Method Detail

setTypeMap

public static void setTypeMap(java.util.Map map)
Sets a mapping to determine if field is a nested struct. Map is obtained from java.sql.Connection.getTypeMap(), with keys being UTD type names (String) and values being Class objects.

Parameters:
map - Map containing Class objects as values

addField

public void addField(FieldBean fBean)
Adds FieldBean to end of contained list

Parameters:
fBean - FieldBean to add

addField

public void addField(int index,
                     FieldBean fBean)
Adds FieldBean to end of contained list at given index

Parameters:
index - index where FieldBean should go
fBean - FieldBean to add

toElement

public final org.jdom.Element toElement()
Returns a JDOM Element representing this Struct object.

Returns:
a JDOM Element representing this Struct object.

toString

public final java.lang.String toString()
Returns the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this object.