RESOLVED - issue BATCH-393: DefaultFieldSet should not always trim whitespace from the value returned

http://jira.springframework.org/browse/BATCH-393

added readRawString(int) and readRawString(String) methods to FieldSet interface
This commit is contained in:
robokaso
2008-03-04 10:17:07 +00:00
parent 21fb94a079
commit c42a6ea147
3 changed files with 42 additions and 0 deletions

View File

@@ -95,6 +95,22 @@ public class DefaultFieldSet implements FieldSet {
public String readString(String name) {
return readString(indexOf(name));
}
/*
* (non-Javadoc)
* @see org.springframework.batch.io.file.mapping.IFieldSet#readRawString(int)
*/
public String readRawString(int index) {
return tokens[index];
}
/*
* (non-Javadoc)
* @see org.springframework.batch.io.file.mapping.IFieldSet#readRawString(java.lang.String)
*/
public String readRawString(String name) {
return readRawString(indexOf(name));
}
/*
* (non-Javadoc)

View File

@@ -61,6 +61,23 @@ public interface FieldSet {
*/
String readString(String name);
/**
* Read the {@link String} value at index '<code>index</code>' including
* trailing whitespace (don't trim).
*
* @param index the field index.
* @throws IndexOutOfBoundsException if the index is out of bounds.
*/
String readRawString(int index);
/**
* Read the {@link String} value from column with given '<code>name</code>'
* including trailing whitespace (don't trim).
*
* @param name the field name.
*/
String readRawString(String name);
/**
* Read the '<code>boolean</code>' value at index '<code>index</code>'.
*