1 /*******************************************************************************
2 * Copyright (c) 2005, 2006 Imola Informatica.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the LGPL License v2.1
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/lgpl.html
7 *******************************************************************************/
8 /**
9 *
10 */
11 package it.imolinfo.jbi4cics.messageformat;
12
13 import it.imolinfo.jbi4cics.exception.FormatException;
14
15 import java.util.Map;
16
17 /**
18 * Questa e' una tag interface per tutti i mapping descriptor.
19 * @author raffaele
20 *
21 */
22 public interface MappingDescriptor {
23
24 /**
25 * Add a mapping definition to the mapping descriptor.
26 * @param propertyName The name of the property of the resulting bean or XML
27 * @param fieldName The name of the original field
28 * @param fieldDescriptor The data description of original field
29 * @throws FormatException The format exception
30 */
31 public void addFieldMapping(String propertyName,String fieldName, FieldDescriptor fieldDescriptor) throws FormatException;
32
33 /**
34 * Add a mapping definition to the mapping descriptor.
35 * @param propertyName name of the property of the resulting bean or XML
36 * @param fieldIndex index of original field, useful when original name is not available and order id relevant
37 * @param fieldDescriptor data description of original field
38 * @throws FormatException The format exception
39 */
40 public void addFieldMapping(String propertyName,Integer fieldIndex, FieldDescriptor fieldDescriptor) throws FormatException;
41
42 /**
43 *
44 * @return a map mado of <propertyName/proertyIndex,FieldDescriptor>
45 * @throws FormatException The format exception
46 */
47 public Map<String, FieldDescriptor> getFieldMap() throws FormatException;
48
49 /**
50 * Set the java class this mapping descriptor is expected to operate on beanClass.
51 * @param beanClass The Bean Class
52 */
53 public void setBeanClass(Class beanClass);
54
55 /**
56 * Get the java class this mapping descriptor is expected to operate on Class.
57 * @return Class The bean class
58 */
59 public Class getBeanClass();
60
61 /**
62 * @param codePage The code page
63 */
64 public void setCodePage(String codePage);
65 }