public class ItemReader extends Object
| Modifier and Type | Field and Description |
|---|---|
static ItemReader |
ROOT
Special instance used as the reader root.
|
| Constructor and Description |
|---|
ItemReader(ItemReader parentReader,
Method method,
String itemName,
Representation<?> repr)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static ItemReader[] |
createItemReaders(Class<?> rootClazz,
GbinTableProfile profile)
Constructs a list of objects that can each read a field from
an object.
|
static String |
getColumnName(ItemReader rdr,
Map<String,List<ItemReader>> nameMap,
boolean forceHier,
String separator)
Works out what name to use for the table column using data from a
given item reader.
|
Class<?> |
getItemContentClass()
Returns the class of objects returned by
readItem |
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.
|
Object |
readItem(Map<ItemReader,Object> itemMap)
Reads the value for this reader in the context of a given
row object.
|
public static final ItemReader ROOT
public ItemReader(ItemReader parentReader, Method method, 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 representationpublic boolean isRoot()
public ItemReader getParentReader()
public String getItemName()
public Class<?> getItemContentClass()
readItempublic Object readItem(Map<ItemReader,Object> itemMap) throws IOException
itemMap - reader->value map, may be modifiedIOExceptionpublic static ItemReader[] createItemReaders(Class<?> rootClazz, GbinTableProfile profile)
rootClazz - class of per-row elementprofile - table configurationpublic static String getColumnName(ItemReader rdr, Map<String,List<ItemReader>> nameMap, boolean forceHier, 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 nameCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.