|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.gbin.ItemReader
public class ItemReader
Object which can read the value of a given table column from the (GaiaRoot) data object representing a table row. ItemReaders are arranged hierarchically, since objects may contain objects, and it is in general the leaf nodes that get turned into columns.
| Field Summary | |
|---|---|
static ItemReader |
ROOT
Special instance used as the reader root. |
| Constructor Summary | |
|---|---|
ItemReader(ItemReader parentReader,
java.lang.reflect.Method method,
java.lang.String itemName,
Representation<?> repr)
Constructor. |
|
| Method Summary | |
|---|---|
static ItemReader[] |
createItemReaders(java.lang.Class rootClazz,
GbinTableProfile profile)
Constructs a list of objects that can each read a field from an object. |
static java.lang.String |
getColumnName(ItemReader rdr,
java.util.Map<java.lang.String,java.util.List<ItemReader>> nameMap,
boolean forceHier,
java.lang.String separator)
Works out what name to use for the table column using data from a given item reader. |
java.lang.Class<?> |
getItemContentClass()
Returns the class of objects returned by readItem |
java.lang.String |
getItemName()
Returns the (non-hierarchical) name of the data item represented by this reader. |
ItemReader |
getParentReader()
Returns the parent of this reader. |
boolean |
isRoot()
Determines whether this instance is the tree root. |
java.lang.Object |
readItem(java.util.Map<ItemReader,java.lang.Object> itemMap)
Reads the value for this reader in the context of a given row object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ItemReader ROOT
| Constructor Detail |
|---|
public ItemReader(ItemReader parentReader,
java.lang.reflect.Method method,
java.lang.String itemName,
Representation<?> repr)
parentReader - parent instancemethod - the no-arg public instance method whose return
value when applied to the parent reader's object
gives this column's valueitemName - basic name for this itemrepr - value representation| Method Detail |
|---|
public boolean isRoot()
public ItemReader getParentReader()
public java.lang.String getItemName()
public java.lang.Class<?> getItemContentClass()
readItem
public java.lang.Object readItem(java.util.Map<ItemReader,java.lang.Object> itemMap)
throws java.io.IOException
itemMap - reader->value map, may be modified
java.io.IOException
public static ItemReader[] createItemReaders(java.lang.Class rootClazz,
GbinTableProfile profile)
rootClazz - class of per-row elementprofile - table configuration
public static java.lang.String getColumnName(ItemReader rdr,
java.util.Map<java.lang.String,java.util.List<ItemReader>> nameMap,
boolean forceHier,
java.lang.String separator)
rdr - item reader supplying datanameMap - map of all item reader names to a list of the
item readers having that name; it can be used to detect
name duplicationforceHier - true iff hierarchical names should always be usedseparator - separator string for components of a hierarchical
column name
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||