ru.sstu.tables
Class ArrayMapping<T>

java.lang.Object
  extended by ru.sstu.tables.Mapping<T>
      extended by ru.sstu.tables.ArrayMapping<T>
Type Parameters:
T - Java Bean type

public class ArrayMapping<T>
extends Mapping<T>

ArrayMapping class is used for mapping between array elements and columns of table.

Since:
Tables 1.0
Author:
Denis_Murashev

Constructor Summary
ArrayMapping(Class<T> type, int length)
          Initializes mapping.
 
Method Summary
 T createObject()
          Creates new mapped object instance.
 void setValue(T object, int index, Object value)
          Sets value to the Java Bean field.
 
Methods inherited from class ru.sstu.tables.Mapping
addField, addField, checkIndex, getMaxIndex, getSkipRows, getTableIndex, getTableReader, getType, setClass, setSkipRows, setTableIndex, setTableReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayMapping

public ArrayMapping(Class<T> type,
                    int length)
             throws TableException
Initializes mapping.

Parameters:
type - array type (String[].class, for example)
length - array length
Throws:
TableException - if cannot map array
Method Detail

createObject

public T createObject()
               throws TableException
Creates new mapped object instance.

Overrides:
createObject in class Mapping<T>
Returns:
new object instance
Throws:
TableException - if cannot create object

setValue

public void setValue(T object,
                     int index,
                     Object value)
              throws TableException
Sets value to the Java Bean field.

Overrides:
setValue in class Mapping<T>
Parameters:
object - Java Bean object
index - table column index
value - value to be set
Throws:
TableException - if cannot set value


Copyright © 2012 TFI branch of Engels Instutute of Technology. All Rights Reserved.