View Javadoc

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.service.ServiceContext;
14  
15  
16  /**
17   * @author raffaele
18   *
19   */
20  public class ToStringMessageFormatter implements MessageFormatter {
21  	
22  	/**
23  	 * void constructor.
24  	 */
25  	  public ToStringMessageFormatter(){
26  	  }
27  
28  
29  	/* (non-Javadoc)
30  	 * @see it.imolinfo.jbi4cics.messageformat.MessageFormatter#mapInputBeanToInputMessage(java.lang.Object, it.imolinfo.jbi4cics.service.ServiceContext)
31  	 */
32  	public void mapInputBeanToInputMessage(ServiceContext serviceContext) {
33      serviceContext.setInputMessage(serviceContext.getInputBean().toString());
34  	}
35  
36  	/* (non-Javadoc)
37  	 * @see it.imolinfo.jbi4cics.messageformat.MessageFormatter#mapOutputMessageToOutputBean(java.lang.Object, it.imolinfo.jbi4cics.service.ServiceContext)
38  	 */
39  	public void mapOutputMessageToOutputBean(ServiceContext serviceContext) {
40      serviceContext.setOutputBean(serviceContext.getOutputMessage().toString());		
41  	}
42  
43  
44  
45  }