本文整理汇总了Java中org.springframework.batch.item.file.transform.FieldSet.readString方法的典型用法代码示例。如果您正苦于以下问题:Java FieldSet.readString方法的具体用法?Java FieldSet.readString怎么用?Java FieldSet.readString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.batch.item.file.transform.FieldSet
的用法示例。
在下文中一共展示了FieldSet.readString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapFieldSet
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
@Override
public CompetitiveIntelligenceReports mapFieldSet(final FieldSet fieldSet) throws BindException {
final String year = fieldSet.readString(YEAR);
if (Strings.isNotBlank(year)) {
final String[] yearSplit = year.split(" ");
Assertions.assertThat(yearSplit).hasSize(2);
curYear = Integer.parseInt(yearSplit[1]);
}
final String title = fieldSet.readString(TITLE);
if (Strings.isBlank(title)) {
return INVALID_ROW;
}
final String categoryStr = fieldSet.readString(CATEGORY);
if (Strings.isNotBlank(categoryStr)) {
curCategory = CompetitiveIntelligenceReportParserCategory.valueOfTitle(categoryStr);
}
parseCompanyLetters(fieldSet, title);
parseAvg(fieldSet, title);
return reports;
}
示例2: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category1 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY1);
if ("N.A. Market----------------".equals(category1)) {
curRegion = CompanyRegion.NorthAmerica;
} else if ("E-A Market----------------".equals(category1)) {
curRegion = CompanyRegion.EuropeAfrica;
} else if ("A-P Market----------------".equals(category1)) {
curRegion = CompanyRegion.AsiaPacific;
//
} else if ("L.A. Market----------------".equals(category1)) {
curRegion = CompanyRegion.LatinAmerica;
}
final String title1 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE1);
if (Strings.isNotBlank(title1)) {
curTitle1 = title1;
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}
示例3: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category1 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY1);
if (Strings.isNotBlank(category1)) {
curCategory1 = category1;
curCategory2 = null;
curTitle1 = null;
curTitle2 = null;
}
final String category2 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY2);
if (Strings.isNotBlank(category2)) {
curCategory2 = category2;
curTitle1 = null;
curTitle2 = null;
}
final String title1 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE1);
if (Strings.isNotBlank(title1)) {
curTitle1 = title1;
//
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}
示例4: mapFieldSet
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
@Override
public T mapFieldSet(FieldSet fieldSet) throws BindException {
T entity = null;
Integer indexColumn = fileOption.getKeyColumn();
String indexColumnName = fieldSet.getNames()[indexColumn];
Function<String, T> finder = getEntityFinder(indexColumnName);
if (finder == null) {
throw new BindException(entityType, "finder '" + indexColumnName + "' not found.");
}
String indexColumnValue = fieldSet.readString(indexColumn);
entity = finder.apply(indexColumnValue);
if (entity == null) {
entity = newEntitySupplier.get();
}
bindData(entity, fieldSet.getProperties());
return entity;
}
示例5: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category1 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY1);
if (Strings.isNotBlank(category1)) {
curCategory1 = category1;
curCategory2 = null;
curTitle2 = null;
}
final String category2 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY2);
if (Strings.isNotBlank(category2)) {
curCategory2 = category2;
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}
示例6: mapFieldSet
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
@Override
public CompanyOperatingReports mapFieldSet(final FieldSet fieldSet) throws BindException {
final String subReport = fieldSet.readString(SUB_REPORT);
if (Strings.isNotBlank(subReport)) {
final CompanyOperatingReportParserSubReport newSubReport = CompanyOperatingReportParserSubReport
.valueOfTitle(curSubReport, subReport);
if (newSubReport != curSubReport) {
curSubReport = newSubReport;
curSubReportParser = curSubReport.newSubReportParser();
}
}
if (Strings.isBlank(fieldSet.readString(SUB_REPORT)) && Strings.isBlank(fieldSet.readString(CATEGORY1))
&& Strings.isBlank(fieldSet.readString(CATEGORY2)) && Strings.isBlank(fieldSet.readString(TITLE1))
&& Strings.isBlank(fieldSet.readString(TITLE2)) || Strings.isBlank(fieldSet.readString(VALUE))) {
return INVALID_ROW;
}
if (curSubReportParser != null) {
curSubReportParser.parse(fieldSet, reports);
return reports;
} else {
return INVALID_ROW;
}
}
示例7: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category1 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY1);
if (Strings.isNotBlank(category1)) {
curCategory1 = category1;
curCategory2 = null;
curTitle1 = null;
curTitle2 = null;
}
final String category2 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY2);
if (Strings.isNotBlank(category2)) {
curCategory2 = category2;
curTitle1 = null;
curTitle2 = null;
}
final String title1 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE1);
if (Strings.isNotBlank(title1)) {
curTitle1 = title1;
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}
示例8: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category1 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY1);
if (Strings.isNotBlank(category1)) {
curCategory1 = category1;
curTitle1 = null;
curTitle2 = null;
}
final String title1 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE1);
if (Strings.isNotBlank(title1)) {
curTitle1 = title1;
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}
示例9: mapFieldSet
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
@Override
public Product mapFieldSet(FieldSet fieldSet) throws BindException {
String id = fieldSet.readString("id");
Product product = null;
if (id.startsWith("PRB")) {
product = new BookProduct();
} else if (id.startsWith("PRM")) {
product = new MobilePhoneProduct();
} else {
product = new Product();
}
product.setId(id);
product.setName(fieldSet.readString("name"));
product.setDescription(fieldSet.readString("description"));
product.setPrice(fieldSet.readFloat("price"));
return product;
}
示例10: readInteger
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
private static Integer readInteger(final FieldSet fieldSet, final int fieldCounter, final boolean castFromDouble) {
final String rawValue = fieldSet.readString(fieldCounter);
if (StringUtils.isNotBlank(rawValue)) {
if (castFromDouble) {
return Double.valueOf(rawValue).intValue();
}
return Integer.valueOf(rawValue);
}
return null;
}
示例11: readInteger
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
private static Integer readInteger(FieldSet fieldSet, int fieldCounter) {
String rawValue = fieldSet.readString(fieldCounter);
if (StringUtils.isNotBlank(rawValue)) {
return Integer.parseInt(rawValue);
}
return null;
}
示例12: readLocalDate
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
private static LocalDate readLocalDate(FieldSet fieldSet, int fieldCounter) {
String rawValue = fieldSet.readString(fieldCounter);
if (StringUtils.isNotBlank(rawValue)) {
return DATE_TIME_FORMATTER.parseLocalDate(rawValue);
}
return null;
}
示例13: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category1 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY1);
if ("N.A.------------".equals(category1)) {
curRegion = CompanyRegion.NorthAmerica;
} else if ("E-A------------".equals(category1)) {
curRegion = CompanyRegion.EuropeAfrica;
} else if ("A-P------------".equals(category1)) {
curRegion = CompanyRegion.AsiaPacific;
} else if ("L.A.------------".equals(category1)) {
curRegion = CompanyRegion.LatinAmerica;
}
final String category2 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY2);
if (Strings.isNotBlank(category2)) {
curCategory2 = category2;
curTitle1 = null;
curTitle2 = null;
}
final String title1 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE1);
if (Strings.isNotBlank(title1)) {
curTitle1 = title1;
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}
示例14: mapFieldSet
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
@Override
public String[] mapFieldSet(FieldSet fieldSet) throws BindException {
List<String> record = new ArrayList<String>();
for(String db : dbNames){
String value = (properties.getProperty(db) != null) ? fieldSet.readString(properties.getProperty(db)) : "";
value = (value.length() > 0) ? mapValue(db, value) : null; // if value is empty string then assign null
record.add(value);
}
return record.toArray(new String[0]);
}
示例15: updateCategoryAndTitle
import org.springframework.batch.item.file.transform.FieldSet; //导入方法依赖的package包/类
protected void updateCategoryAndTitle(final FieldSet fieldSet) {
final String category2 = fieldSet.readString(CompanyOperatingReportParserMapper.CATEGORY2);
if (Strings.isNotBlank(category2)) {
curCategory2 = category2;
curTitle2 = null;
}
final String title2 = fieldSet.readString(CompanyOperatingReportParserMapper.TITLE2);
if (Strings.isNotBlank(title2)) {
curTitle2 = title2;
}
}