View Javadoc

1   package org.springframework.batch.sample.domain.order.internal.extractor;
2   
3   import org.springframework.batch.item.file.transform.FieldExtractor;
4   import org.springframework.batch.sample.domain.order.Address;
5   import org.springframework.batch.sample.domain.order.Order;
6   
7   /**
8    * @author Dan Garrette
9    * @since 2.0.1
10   */
11  public class AddressFieldExtractor implements FieldExtractor<Order> {
12  
13  	public Object[] extract(Order order) {
14  		Address address = order.getBillingAddress();
15  		return new Object[] { "ADDRESS:", address.getAddrLine1(), address.getCity(), address.getZipCode() };
16  	}
17  
18  }