* @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
*/
public class UNAHandler implements ControlBlockHandler {
public void process(InterchangeContext interchangeContext) throws IOException, SAXException {
Delimiters delimiters = new Delimiters();
BufferedSegmentReader segmentReader = interchangeContext.getSegmentReader();
// The UNA segment code is still in the segment buffer... clear it before
// reading the segment delimiters...
segmentReader.getSegmentBuffer().setLength(0);
// Read the delimiter chars one-by-one and set in the Delimiters instance...
// 1st char is the component ("sub-element") delimiter...
delimiters.setComponent( segmentReader.read(1));
// 2nd char is the field ("data-element") delimiter...
delimiters.setField( segmentReader.read(1));
// 3rd char is the decimal point indicator...
delimiters.setDecimalSeparator(segmentReader.read(1));
// 4th char is the escape char ("release")...
delimiters.setEscape( segmentReader.read(1));
// 5th char is reserved for future use...
segmentReader.read(1);
// 6th char is the segment delimiter...
delimiters.setSegment( segmentReader.read(1));
interchangeContext.pushDelimiters(delimiters);
}