1 /* 2 * Copyright 2012 Olivier Godineau 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * the License at http://www.apache.org/licenses/LICENSE-2.0 7 * 8 * Unless required by applicable law or agreed to in writing, software 9 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 * License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 package olg.csv.bean; 15 16 import olg.csv.base.Row; 17 import olg.csv.bean.parser.ParseException; 18 19 /** 20 * In reading process, set properties of a bean from a row. 21 * 22 * @author Olivier Godineau 23 * 24 * @param <B> 25 * bean the processor deals with. 26 */ 27 public interface IPropertyProcessor<B> { 28 29 /** 30 * Returns the bean after this transformer sets its property from a row. 31 * 32 * @param line 33 * the row. list of strings which represents the property of the 34 * bean 35 * @param bean 36 * the bean this transformer set property (or properties). 37 * @return the given bean.If the given bean is <code>null</code> a new 38 * instance is created and returned. 39 * @throws ParseException 40 * if error occurs during parsing 41 */ 42 B transform(Row line, B bean) throws ParseException; 43 44 }