Creating a Bean - 7.1

ConvertBody - Mediation

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Talend Studio
Data Governance > Third-party systems > Processing components (Mediation) > ConvertBody components (Mediation)
Data Quality and Preparation > Third-party systems > Processing components (Mediation) > ConvertBody components (Mediation)
Design and Development > Third-party systems > Processing components (Mediation) > ConvertBody components (Mediation)


  1. From the repository tree view, expand the Code node and right click the Beans node. In the contextual menu, select Create Bean.
  2. The New Bean wizard opens. In the Name field, type in a name for the bean, for example, PrintConvertToBean. Click Finish to close the wizard.
  3. Enter the following code in the design workspace.
    package beans;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    public class PrintConvertToBean {
    	 * print input message
    	 * @param message
    	public static void helloExample(Document message) {
    		if (message == null) {
    			System.out.println("There's no message here!");
    		Element rootElement = message.getDocumentElement();
    		if (rootElement == null) {
    			System.out.println("There's no root element here!");
    		System.out.println("The root element name is:"
    				+ rootElement.getNodeName());
    		System.out.println("The book categories are:");
    		NodeList types = rootElement.getElementsByTagName("category");
    		for(int i = 0;i<types.getLength();i++){
    			Element child = (Element) types.item(i);
  4. Press Ctrl+S to save your bean.


For more information about creating and using JavaBeans, see Talend Studio User Guide.