Interface BindyFactory
- All Known Implementing Classes:
BindyAbstractFactory
,BindyCsvFactory
,BindyFixedLengthFactory
,BindyKeyValuePairFactory
public interface BindyFactory
The bindy factory is a factory used to create the POJO models and bind or unbind the data to and from the record
(CSV, ...)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(org.apache.camel.CamelContext camelContext, List<String> data, Map<String, Object> model, int line) The bind allow to read the content of a record (expressed as a List) and map it to the model classes. void
Prior to bind or unbind the data to and from string or model classes, the factory must create a collection of objects representing the modelThe unbind is used to transform the content of the classes model objects into a string.
-
Method Details
-
initModel
Prior to bind or unbind the data to and from string or model classes, the factory must create a collection of objects representing the model- Throws:
Exception
- can be thrown
-
bind
void bind(org.apache.camel.CamelContext camelContext, List<String> data, Map<String, Object> model, int line) throws ExceptionThe bind allow to read the content of a record (expressed as a List) and map it to the model classes. - Parameters:
data
- Listrepresents the csv, ... data to transform model
- Mapinvalid input: '<'String, object> is a collection of objects used to bind data. String is the key name of the class link to POJO objectsline
- is the position of the record into the file- Throws:
Exception
- can be thrown
-
unbind
String unbind(org.apache.camel.CamelContext camelContext, Map<String, Object> model) throws ExceptionThe unbind is used to transform the content of the classes model objects into a string. The string represents a record of a CSV file- Parameters:
model
- Mapinvalid input: '<'String, Object> is a collection of objects used to create csv, ... records. String is the key name of the class link to POJO objects- Returns:
- String represents a csv record created
- Throws:
Exception
- can be thrown
-