Class LineBasedAdapter

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public abstract class LineBasedAdapter
    extends SimpleAdapter
    Abstract adapter dedicated to line based input streams.
    This class (and its child classes) cannot be instanciated.
    They correspond to an Adapter configuration item.
    The only method to implement is the single line level processLine method:
     public String processLine(long lineNumber, String line) throws PlatformException, InterruptedException {
         // return the line transformed into a Simplicité XML block or null to ignore (e.g. if the line has been processed within this method)
         return null;
    See Also:
    Serialized Form
    • Constructor Detail

      • LineBasedAdapter

        public LineBasedAdapter()
    • Method Detail

      • readLine

        public java.lang.String readLine()
        Default read line to the next line feed ('\n') or carriage return ('\r'). Method has to be overrided if the line is delimited by something else.
        Input line
        Throws: - in case of I/O error
      • process

        public void process()
                     throws java.lang.InterruptedException
        Iterates input stream as individual lines.
        Each line is passed to the processLine method for processing.
        java.lang.InterruptedException - if interrupted
      • processLine

        public abstract java.lang.String processLine​(long lineNumber,
                                                     java.lang.String line)
                                              throws PlatformException,
        Line processing to implement.
        lineNumber - Input line number (1 is the first line)
        line - Input line
        Processed line as XML statements or null
        PlatformException - in case of processing error
        java.lang.InterruptedException - if interrupted