Class ScriptParser

java.lang.Object
org.oddjob.sql.ScriptParser
All Implemented Interfaces:
Runnable, ArooaSessionAware, BusDriver<String>, Outbound<String>, Stoppable

public class ScriptParser extends Object implements BusDriver<String>, ArooaSessionAware, Stoppable
Parses SQL from an InputStream into individual statements.
Author:
rob
  • Constructor Details

    • ScriptParser

      public ScriptParser()
  • Method Details

    • setArooaSession

      public void setArooaSession(ArooaSession session)
      Description copied from interface: ArooaSessionAware
      Accept the current Arooa Session.
      Specified by:
      setArooaSession in interface ArooaSessionAware
      Parameters:
      session - The Arooa Session. Never null.
    • isKeepFormat

      public boolean isKeepFormat()
      Getter for keepFormat.
      Returns:
      keepFormat flag.
    • setKeepFormat

      public void setKeepFormat(boolean keepformat)
      Setter for keepFormat
      Parameters:
      keepformat - The keepFormat flag.
    • isExpandProperties

      public boolean isExpandProperties()
      Getter for expandProperties.
      Returns:
      The expandProperties flag.
    • setExpandProperties

      public void setExpandProperties(boolean expandProperties)
      Setter for exapndProperties.
      Parameters:
      expandProperties - The expandProperties flag.
    • getDelimiterType

      public SQLJob.DelimiterType getDelimiterType()
      Getter for delimiterType.
      Returns:
      The delimiterType.
    • setDelimiterType

      public void setDelimiterType(SQLJob.DelimiterType delimiterType)
      Setter for delimiterType.
      Parameters:
      delimiterType - The delimiterType.
    • getDelimiter

      public String getDelimiter()
      Getter for delimiter.
      Returns:
      The delimiter.
    • setDelimiter

      public void setDelimiter(String delimiter)
      Setter for delimiter.
      Parameters:
      delimiter - The delimiter.
    • getEncoding

      public String getEncoding()
      Getter for encoding.
      Returns:
      The encoding.
    • setEncoding

      public void setEncoding(String encoding)
      Setter for encoding.
      Parameters:
      encoding - The encoding.
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • doProcessing

      protected void doProcessing(InputStream input) throws IOException
      Throws:
      IOException
    • stop

      public void stop()
      Description copied from interface: Stoppable
      Stop executing. This method should not return until the Stoppable has actually stopped.
      Specified by:
      stop in interface Stoppable
    • getInput

      public InputStream getInput()
    • setInput

      public void setInput(InputStream input)
    • setTo

      public void setTo(Consumer<? super String> to)
      Description copied from interface: Outbound
      Set the out bound destination.
      Specified by:
      setTo in interface Outbound<String>
      Parameters:
      to -
    • getTo

      public Consumer<? super String> getTo()
    • toString

      public String toString()
      Overrides:
      toString in class Object