/** * Returns the Loop in X12 {@link java.lang.String} format. This method is used to convert the X12 * object into a X12 transaction. * * @param bRemoveTrailingEmptyElements a flag for whether or not empty trailing elements should be * removed. * @return String representation of the loop. */ public String toString(boolean bRemoveTrailingEmptyElements) { StringBuilder dump = new StringBuilder(); for (Segment s : this.segments) { dump.append(s.toString(bRemoveTrailingEmptyElements)); dump.append(context.getSegmentSeparator()); } for (Loop l : this.childList()) { dump.append(l.toString(bRemoveTrailingEmptyElements)); } return dump.toString(); }