- Common ways to obtain BufferedSegmentReader
private void myMethod () {BufferedSegmentReader b =
InterchangeContext interchangeContext;interchangeContext.getSegmentReader()
InputSource ediInputSource;EdifactModel edifactModel;new BufferedSegmentReader(ediInputSource, edifactModel.getDelimiters())
InputSource ediInputSource;Delimiters rootDelimiters;new BufferedSegmentReader(ediInputSource, rootDelimiters)
- Smart code suggestions by Codota
}
/** * Get the current EDI segment fields. * @return The current EDI segment fields array. * @throws IllegalStateException No current Segment. */ public String[] getCurrentSegmentFields() throws IllegalStateException { assertCurrentSegmentExists(); if(currentSegmentFields == null) { currentSegmentFields = EDIUtils.split(segmentBuffer.toString(), currentDelimiters.getField(), currentDelimiters.getEscape()); // If the segment delimiter is a LF, strip off any preceding CR characters... if(currentDelimiters.getSegment().equals("\n")) { int endIndex = currentSegmentFields.length - 1; if(currentSegmentFields[endIndex].endsWith("\r")) { int stringLen = currentSegmentFields[endIndex].length(); currentSegmentFields[endIndex] = currentSegmentFields[endIndex].substring(0, stringLen - 1); } } } return currentSegmentFields; }
/** * Get the current EDI segment fields. * @return The current EDI segment fields array. * @throws IllegalStateException No current Segment. */ public String[] getCurrentSegmentFields() throws IllegalStateException { assertCurrentSegmentExists(); if(currentSegmentFields == null) { currentSegmentFields = EDIUtils.split(segmentBuffer.toString(), currentDelimiters.getField(), currentDelimiters.getEscape()); // If the segment delimiter is a LF, strip off any preceding CR characters... if(currentDelimiters.getSegment().equals("\n")) { int endIndex = currentSegmentFields.length - 1; if(currentSegmentFields[endIndex].endsWith("\r")) { int stringLen = currentSegmentFields[endIndex].length(); currentSegmentFields[endIndex] = currentSegmentFields[endIndex].substring(0, stringLen - 1); } } } return currentSegmentFields; }
/** * Get the current EDI segment fields. * @return The current EDI segment fields array. * @throws IllegalStateException No current Segment. */ public String[] getCurrentSegmentFields() throws IllegalStateException { assertCurrentSegmentExists(); if(currentSegmentFields == null) { currentSegmentFields = EDIUtils.split(segmentBuffer.toString(), currentDelimiters.getField(), currentDelimiters.getEscape()); // If the segment delimiter is a LF, strip off any preceding CR characters... if(currentDelimiters.getSegment().equals("\n")) { int endIndex = currentSegmentFields.length - 1; if(currentSegmentFields[endIndex].endsWith("\r")) { int stringLen = currentSegmentFields[endIndex].length(); currentSegmentFields[endIndex] = currentSegmentFields[endIndex].substring(0, stringLen - 1); } } } return currentSegmentFields; }
/** * Get the current EDI segment fields. * @return The current EDI segment fields array. * @throws IllegalStateException No current Segment. */ public String[] getCurrentSegmentFields() throws IllegalStateException { assertCurrentSegmentExists(); if(currentSegmentFields == null) { currentSegmentFields = EDIUtils.split(segmentBuffer.toString(), currentDelimiters.getField(), currentDelimiters.getEscape()); // If the segment delimiter is a LF, strip off any preceding CR characters... if(currentDelimiters.getSegment().equals("\n")) { int endIndex = currentSegmentFields.length - 1; if(currentSegmentFields[endIndex].endsWith("\r")) { int stringLen = currentSegmentFields[endIndex].length(); currentSegmentFields[endIndex] = currentSegmentFields[endIndex].substring(0, stringLen - 1); } } } return currentSegmentFields; }