|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.item.file.mapping.DefaultFieldSet
public class DefaultFieldSet
Default implementation of FieldSet using Java using Java primitive
and standard types and utilities. Strings are trimmed before parsing by
default, and so are plain String values.
| Constructor Summary | |
|---|---|
DefaultFieldSet(String[] tokens)
|
|
DefaultFieldSet(String[] tokens,
String[] names)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object object)
|
int |
getFieldCount()
Return the number of fields in this ' FieldSet'. |
String[] |
getNames()
Accessor for the names of the fields. |
Properties |
getProperties()
Construct name-value pairs from the field names and string values. |
String[] |
getValues()
|
int |
hashCode()
|
protected int |
indexOf(String name)
Read and trim the String value from column with given 'name. |
protected String |
readAndTrim(int index)
Read and trim the String value at 'index'. |
BigDecimal |
readBigDecimal(int index)
Read the BigDecimal value at index 'index'. |
BigDecimal |
readBigDecimal(int index,
BigDecimal defaultValue)
Read the BigDecimal value at index 'index',
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank. |
BigDecimal |
readBigDecimal(String name)
Read the BigDecimal value from column with given 'name. |
BigDecimal |
readBigDecimal(String name,
BigDecimal defaultValue)
Read the BigDecimal value from column with given 'name,
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank. |
boolean |
readBoolean(int index)
Read the ' boolean' value at index 'index'. |
boolean |
readBoolean(int index,
String trueValue)
Read the ' boolean' value at index 'index'. |
boolean |
readBoolean(String name)
Read the ' boolean' value from column with given 'name'. |
boolean |
readBoolean(String name,
String trueValue)
Read the ' boolean' value from column with given 'name'. |
byte |
readByte(int index)
Read the ' byte' value at index 'index'. |
byte |
readByte(String name)
Read the ' byte' value from column with given 'name'. |
char |
readChar(int index)
Read the ' char' value at index 'index'. |
char |
readChar(String name)
Read the ' char' value from column with given 'name'. |
Date |
readDate(int index)
Read the java.util.Date value in default format at
designated column index. |
Date |
readDate(int index,
String pattern)
Read the java.util.Date value in default format at
designated column index. |
Date |
readDate(String name)
Read the java.sql.Date value in given format from column
with given name. |
Date |
readDate(String name,
String pattern)
Read the java.sql.Date value in given format from column
with given name. |
double |
readDouble(int index)
Read the ' double' value at index 'index'. |
double |
readDouble(String name)
Read the ' double' value from column with given 'name. |
float |
readFloat(int index)
Read the ' float' value at index 'index'. |
float |
readFloat(String name)
Read the ' float' value from column with given 'name. |
int |
readInt(int index)
Read the ' int' value at index 'index'. |
int |
readInt(int index,
int defaultValue)
Read the ' int' value at index 'index',
using the supplied defaultValue if the field value is
blank. |
int |
readInt(String name)
Read the ' int' value from column with given 'name'. |
int |
readInt(String name,
int defaultValue)
Read the ' int' value from column with given 'name',
using the supplied defaultValue if the field value is
blank. |
long |
readLong(int index)
Read the ' long' value at index 'index'. |
long |
readLong(int index,
long defaultValue)
Read the ' long' value at index 'index',
using the supplied defaultValue if the field value is
blank. |
long |
readLong(String name)
Read the ' long' value from column with given 'name'. |
long |
readLong(String name,
long defaultValue)
Read the ' long' value from column with given 'name',
using the supplied defaultValue if the field value is
blank. |
String |
readRawString(int index)
Read the String value at index 'index' including
trailing whitespace (don't trim). |
String |
readRawString(String name)
Read the String value from column with given 'name'
including trailing whitespace (don't trim). |
short |
readShort(int index)
Read the ' short' value at index 'index'. |
short |
readShort(String name)
Read the ' short' value from column with given 'name'. |
String |
readString(int index)
Read the String value at index 'index'. |
String |
readString(String name)
Read the String value from column with given 'name'. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFieldSet(String[] tokens)
public DefaultFieldSet(String[] tokens,
String[] names)
| Method Detail |
|---|
public String[] getNames()
FieldSet
getNames in interface FieldSetpublic String[] getValues()
getValues in interface FieldSetFieldSet' instance as
String values.public String readString(int index)
FieldSetString value at index 'index'.
readString in interface FieldSetindex - the field index.public String readString(String name)
FieldSetString value from column with given 'name'.
readString in interface FieldSetname - the field name.public String readRawString(int index)
FieldSetString value at index 'index' including
trailing whitespace (don't trim).
readRawString in interface FieldSetindex - the field index.public String readRawString(String name)
FieldSetString value from column with given 'name'
including trailing whitespace (don't trim).
readRawString in interface FieldSetname - the field name.public boolean readBoolean(int index)
FieldSetboolean' value at index 'index'.
readBoolean in interface FieldSetindex - the field index.public boolean readBoolean(String name)
FieldSetboolean' value from column with given 'name'.
readBoolean in interface FieldSetname - the field name.
public boolean readBoolean(int index,
String trueValue)
FieldSetboolean' value at index 'index'.
readBoolean in interface FieldSetindex - the field index.trueValue - the value that signifies true;
case-sensitive.
public boolean readBoolean(String name,
String trueValue)
FieldSetboolean' value from column with given 'name'.
readBoolean in interface FieldSetname - the field name.trueValue - the value that signifies true;
case-sensitive.public char readChar(int index)
FieldSetchar' value at index 'index'.
readChar in interface FieldSetindex - the field index.public char readChar(String name)
FieldSetchar' value from column with given 'name'.
readChar in interface FieldSetname - the field name.public byte readByte(int index)
FieldSetbyte' value at index 'index'.
readByte in interface FieldSetindex - the field index.public byte readByte(String name)
FieldSetbyte' value from column with given 'name'.
readByte in interface FieldSetname - the field name.public short readShort(int index)
FieldSetshort' value at index 'index'.
readShort in interface FieldSetindex - the field index.public short readShort(String name)
FieldSetshort' value from column with given 'name'.
readShort in interface FieldSetname - the field name.public int readInt(int index)
FieldSetint' value at index 'index'.
readInt in interface FieldSetindex - the field index.public int readInt(String name)
FieldSetint' value from column with given 'name'.
readInt in interface FieldSetname - the field name.
public int readInt(int index,
int defaultValue)
FieldSetint' value at index 'index',
using the supplied defaultValue if the field value is
blank.
readInt in interface FieldSetindex - the field index..
public int readInt(String name,
int defaultValue)
FieldSetint' value from column with given 'name',
using the supplied defaultValue if the field value is
blank.
readInt in interface FieldSetname - the field name.public long readLong(int index)
FieldSetlong' value at index 'index'.
readLong in interface FieldSetindex - the field index.public long readLong(String name)
FieldSetlong' value from column with given 'name'.
readLong in interface FieldSetname - the field name.
public long readLong(int index,
long defaultValue)
FieldSetlong' value at index 'index',
using the supplied defaultValue if the field value is
blank.
readLong in interface FieldSetindex - the field index..
public long readLong(String name,
long defaultValue)
FieldSetlong' value from column with given 'name',
using the supplied defaultValue if the field value is
blank.
readLong in interface FieldSetname - the field name.public float readFloat(int index)
FieldSetfloat' value at index 'index'.
readFloat in interface FieldSetindex - the field index.public float readFloat(String name)
FieldSetfloat' value from column with given 'name.
readFloat in interface FieldSetname - the field name.public double readDouble(int index)
FieldSetdouble' value at index 'index'.
readDouble in interface FieldSetindex - the field index.public double readDouble(String name)
FieldSetdouble' value from column with given 'name.
readDouble in interface FieldSetname - the field name.public BigDecimal readBigDecimal(int index)
FieldSetBigDecimal value at index 'index'.
readBigDecimal in interface FieldSetindex - the field index.public BigDecimal readBigDecimal(String name)
FieldSetBigDecimal value from column with given 'name.
readBigDecimal in interface FieldSetname - the field name.
public BigDecimal readBigDecimal(int index,
BigDecimal defaultValue)
FieldSetBigDecimal value at index 'index',
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank.
readBigDecimal in interface FieldSetindex - the field index.
public BigDecimal readBigDecimal(String name,
BigDecimal defaultValue)
FieldSetBigDecimal value from column with given 'name,
returning the supplied defaultValue if the trimmed string
value at index 'index' is blank.
readBigDecimal in interface FieldSetname - the field name.public Date readDate(int index)
FieldSetjava.util.Date value in default format at
designated column index.
readDate in interface FieldSetindex - the field index.public Date readDate(String name)
FieldSetjava.sql.Date value in given format from column
with given name.
readDate in interface FieldSetname - the field name.
public Date readDate(int index,
String pattern)
FieldSetjava.util.Date value in default format at
designated column index.
readDate in interface FieldSetindex - the field index.pattern - the pattern describing the date and time format
public Date readDate(String name,
String pattern)
FieldSetjava.sql.Date value in given format from column
with given name.
readDate in interface FieldSetname - the field name.pattern - the pattern describing the date and time formatpublic int getFieldCount()
FieldSetFieldSet'.
getFieldCount in interface FieldSetprotected String readAndTrim(int index)
String value at 'index'.
NullPointerException - if the field value is null.protected int indexOf(String name)
String value from column with given 'name.
IllegalArgumentException - if a column with given name is not
defined.public String toString()
toString in class Objectpublic boolean equals(Object object)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class Objectpublic Properties getProperties()
FieldSet
getProperties in interface FieldSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||