|
Copyright © 2008-2011 Ralph Schuster. All Rights Reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsv.util.BeanReader
public class BeanReader
Reads beans from the underlying table stream.
| Constructor Summary | |
|---|---|
|
BeanReader(java.lang.Class<?> beanClass,
TableReader reader)
Constructor. |
protected |
BeanReader(java.lang.Class<?> beanClass,
TableReader reader,
boolean evaluateHeaderRow,
java.lang.String[] attributes)
Internal Constructor. |
|
BeanReader(java.lang.Class<?> beanClass,
TableReader reader,
java.lang.String[] attributes)
Constructor. |
| Method Summary | |
|---|---|
void |
close()
Closes the reader. |
java.lang.Object |
convertToBean(java.lang.Object[] columns)
Constructs new bean from values in array. |
protected java.lang.String |
getAttributeName(int columnIndex)
Returns the attribute name of specified column |
java.lang.String[] |
getAttributes()
Returns the attributes that will be used for each column index. |
protected java.lang.reflect.Method |
getMethod(java.lang.String attribute)
Returns the correct setter method object for the given attribute. |
protected java.lang.String |
getMethodName(java.lang.String attribute)
This implementation returns the name of setter method for the given attribute |
boolean |
hasNext()
Returns true when there are more beans to be returned. |
boolean |
isEvaluateHeaderRow()
Returns true if attribute names will be evaluated from header row. |
protected boolean |
isValidSetterMethod(java.lang.reflect.Method method)
Returns true if method conforms to JavaBean style of a Setter. |
java.lang.Object |
next()
Returns the next bean from the table reader. |
void |
readHeaderRow()
Reads the next row from stream and sets the attribute names. |
void |
remove()
Method not supported. |
void |
reset()
Resets the reader. |
protected void |
setAttributes(java.lang.String[] attributes)
Sets the attribute names to be set for each column. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeanReader(java.lang.Class<?> beanClass,
TableReader reader)
beanClass - the beanClassreader - the underlying reader to read bean properties from
public BeanReader(java.lang.Class<?> beanClass,
TableReader reader,
java.lang.String[] attributes)
beanClass - the beanClassreader - the underlying reader to read bean properties fromattributes - list of attribute names that will be used to create the beans
protected BeanReader(java.lang.Class<?> beanClass,
TableReader reader,
boolean evaluateHeaderRow,
java.lang.String[] attributes)
beanClass - the beanClassreader - the underlying reader to read bean properties fromattributes - list of attribute names that will be used to create the beansevaluateHeaderRow - whether header row will be delivered by reader| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iterator<java.lang.Object>Iterator.hasNext(),
Iterator.hasNext()public java.lang.Object next()
next in interface java.util.Iterator<java.lang.Object>Iterator.next(),
Iterator.next(),
convertToBean(Object[])public void reset()
public void close()
public java.lang.Object convertToBean(java.lang.Object[] columns)
columns - attribute values
public void remove()
remove in interface java.util.Iterator<java.lang.Object>Iterator.remove()public boolean isEvaluateHeaderRow()
public java.lang.String[] getAttributes()
protected void setAttributes(java.lang.String[] attributes)
attributes - attribute names to setpublic void readHeaderRow()
protected java.lang.String getAttributeName(int columnIndex)
columnIndex - index of column
protected java.lang.reflect.Method getMethod(java.lang.String attribute)
attribute - attribute to be set
protected boolean isValidSetterMethod(java.lang.reflect.Method method)
method - method
protected java.lang.String getMethodName(java.lang.String attribute)
attribute - attribute
|
Copyright © 2008-2011 Ralph Schuster. All Rights Reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||