Codota Logo
BufferedSegmentReader.assertCurrentSegmentExists
Code IndexAdd Codota to your IDE (free)

How to use
assertCurrentSegmentExists
method
in
org.milyn.edisax.BufferedSegmentReader

Best Java code snippets using org.milyn.edisax.BufferedSegmentReader.assertCurrentSegmentExists (Showing top 4 results out of 315)

  • Common ways to obtain BufferedSegmentReader
private void myMethod () {
BufferedSegmentReader b =
  • Codota IconInterchangeContext interchangeContext;interchangeContext.getSegmentReader()
  • Codota IconInputSource ediInputSource;EdifactModel edifactModel;new BufferedSegmentReader(ediInputSource, edifactModel.getDelimiters())
  • Codota IconInputSource ediInputSource;Delimiters rootDelimiters;new BufferedSegmentReader(ediInputSource, rootDelimiters)
  • Smart code suggestions by Codota
}
origin: org.milyn/milyn-smooks-all

/**
 * 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;
}
origin: org.virtuslab/milyn-edisax-parser

/**
 * 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;
}
origin: smooks/smooks

/**
 * 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;
}
origin: org.milyn/milyn-edisax-parser

/**
 * 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;
}
org.milyn.edisaxBufferedSegmentReaderassertCurrentSegmentExists

Javadoc

Assert that there is a current segment.

Popular methods of BufferedSegmentReader

  • <init>
    Construct the stream reader.
  • changeEncoding
    Change the encoding used to read the underlying EDI data stream. #mark() should have been called fir
  • forwardPastWhitespace
  • getCurrentSegmentFields
    Get the current EDI segment fields.
  • getCurrentSegmentNumber
    Get the current segment "number". The first segment is "segment number 1".
  • getDelimiters
    Get the current delimiter set.
  • getSegmentBuffer
    Get the segment buffer.
  • hasCurrentSegment
    Does the read have a segment buffered and ready for processing.
  • mark
    Try mark the stream so we can support changing of the reader encoding.
  • moveToNextSegment
    Move to the next EDI segment. Simply reads and buffers the next EDI segment.
  • peek
    Peek a fixed number of characters from the input source. Peek differs from #read(int) in that it lea
  • popDelimiters
    Restore the parent delimiters set. Be sure to #getDelimitersStack() and check that it is not empty b
  • peek,
  • popDelimiters,
  • pushDelimiters,
  • read,
  • readChar,
  • setIgnoreNewLines,
  • setSegmentListener

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now