@Test public void getXMLWithId() { DragAndDropContainer dnd = new DragAndDropContainer( DragAndDropContainer.TYPE_BASE_STEP_TYPE, "Step Name", "StepID" ); String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<DragAndDrop>\n" + " <ID>StepID</ID>\n" + " <DragType>BaseStep</DragType>\n" + " <Data>U3RlcCBOYW1l</Data>\n" + "</DragAndDrop>\n"; assertEquals( xml, dnd.getXML() ); }
public String getXML() { try { StringBuilder xml = new StringBuilder( 100 ); xml.append( XMLHandler.getXMLHeader() ); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); if ( id != null ) { xml.append( " " ).append( XMLHandler.addTagValue( "ID", id ) ); } xml.append( " " ).append( XMLHandler.addTagValue( "DragType", getTypeCode() ) ); xml.append( " " ).append( XMLHandler .addTagValue( "Data", new String( Base64.encodeBase64( data.getBytes( Const.XML_ENCODING ) ) ) ) ); xml.append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); return xml.toString(); } catch ( UnsupportedEncodingException e ) { throw new RuntimeException( "Unable to encode String in encoding [" + Const.XML_ENCODING + "]", e ); } }
DragAndDropContainer implements XMLInterface { public String getXML() { try { StringBuilder xml = new StringBuilder( 100 ); xml.append( XMLHandler.getXMLHeader() ); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); if ( id != null ) { xml.append( " " ).append( XMLHandler.addTagValue( "ID", id ) ); } xml.append( " " ).append( XMLHandler.addTagValue( "DragType", getTypeCode() ) ); xml.append( " " ).append( XMLHandler .addTagValue( "Data", new String( Base64.encodeBase64( data.getBytes( Const.XML_ENCODING ) ) ) ) ); xml.append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); return xml.toString(); } catch ( UnsupportedEncodingException e ) { throw new RuntimeException( "Unable to encode String in encoding [" + Const.XML_ENCODING + "]", e ); } } }
DragAndDropContainer implements XMLInterface { public String getXML() { try { StringBuilder xml = new StringBuilder( 100 ); xml.append( XMLHandler.getXMLHeader() ); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); if ( id != null ) { xml.append( " " ).append( XMLHandler.addTagValue( "ID", id ) ); } xml.append( " " ).append( XMLHandler.addTagValue( "DragType", getTypeCode() ) ); xml.append( " " ).append( XMLHandler .addTagValue( "Data", new String( Base64.encodeBase64( data.getBytes( Const.XML_ENCODING ) ) ) ) ); xml.append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); return xml.toString(); } catch ( UnsupportedEncodingException e ) { throw new RuntimeException( "Unable to encode String in encoding [" + Const.XML_ENCODING + "]", e ); } } DragAndDropContainer( int type, String data );  DragAndDropContainer( int type, String data, String id );  DragAndDropContainer( String xml ); }
DragAndDropContainer implements XMLInterface { public String getXML() { try { StringBuilder xml = new StringBuilder( 100 ); xml.append( XMLHandler.getXMLHeader() ); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); if ( id != null ) { xml.append( " " ).append( XMLHandler.addTagValue( "ID", id ) ); } xml.append( " " ).append( XMLHandler.addTagValue( "DragType", getTypeCode() ) ); xml.append( " " ).append( XMLHandler .addTagValue( "Data", new String( Base64.encodeBase64( data.getBytes( Const.XML_ENCODING ) ) ) ) ); xml.append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); return xml.toString(); } catch ( UnsupportedEncodingException e ) { throw new RuntimeException( "Unable to encode String in encoding [" + Const.XML_ENCODING + "]", e ); } } DragAndDropContainer( int type, String data );  DragAndDropContainer( int type, String data, String id );  DragAndDropContainer( String xml ); int getType(); void setType( int type ); String getData(); void setData( String data ); String getId(); void setId( String id ); String getTypeCode(); static final int getType( String typeCode ); String getXML(); }
DragAndDropContainer implements XMLInterface { public String getXML() { try { StringBuilder xml = new StringBuilder( 100 ); xml.append( XMLHandler.getXMLHeader() ); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); if ( id != null ) { xml.append( " " ).append( XMLHandler.addTagValue( "ID", id ) ); } xml.append( " " ).append( XMLHandler.addTagValue( "DragType", getTypeCode() ) ); xml.append( " " ).append( XMLHandler .addTagValue( "Data", new String( Base64.encodeBase64( data.getBytes( Const.XML_ENCODING ) ) ) ) ); xml.append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); return xml.toString(); } catch ( UnsupportedEncodingException e ) { throw new RuntimeException( "Unable to encode String in encoding [" + Const.XML_ENCODING + "]", e ); } } DragAndDropContainer( int type, String data );  DragAndDropContainer( int type, String data, String id );  DragAndDropContainer( String xml ); int getType(); void setType( int type ); String getData(); void setData( String data ); String getId(); void setId( String id ); String getTypeCode(); static final int getType( String typeCode ); String getXML(); static final int TYPE_STEP; static final int TYPE_BASE_STEP_TYPE; static final int TYPE_DATABASE_CONNECTION; static final int TYPE_TRANS_HOP; static final int TYPE_TEXT; static final int TYPE_JOB_ENTRY; static final int TYPE_BASE_JOB_ENTRY; static final int TYPE_PHYSICAL_TABLE; static final int TYPE_PHYSICAL_COLUMN; static final int TYPE_BUSINESS_VIEW; static final int TYPE_BUSINESS_TABLE; static final int TYPE_BUSINESS_COLUMN; static final int TYPE_RELATIONSHIP; static final int TYPE_BUSINESS_MODEL; }