-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAcmeProcessor.java
More file actions
33 lines (29 loc) · 794 Bytes
/
AcmeProcessor.java
File metadata and controls
33 lines (29 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.javaee7.chapter11;
import java.util.List;
import javax.batch.api.chunk.ItemProcessor;
/**
*
* @author Juneau
*/
public class AcmeProcessor implements ItemProcessor {
public AcmeProcessor() {
}
/**
* Write out all lines that contain the text "Two"
*
* @param item
* @return
* @throws Exception
*/
@Override
public WidgetOutputItem processItem(Object item) throws Exception {
List<WidgetReportItem> widgetReportItems = (List<WidgetReportItem>) item;
WidgetOutputItem out = null;
for (WidgetReportItem witem : widgetReportItems) {
if (witem.getLineText().contains("Two")) {
out = new WidgetOutputItem(witem.getLineText());
}
}
return out;
}
}