Class AbstractTextConnection

java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.text.AbstractTextConnection
All Implemented Interfaces:
Connection
Direct Known Subclasses:
CsvConnection, ShellConnection, TextConnection, VelocityConnection

public abstract class AbstractTextConnection extends AbstractConnection
Base class for Text/CSV connections.
Version:
1.0
Author:
Fyodor Kupolov
  • Field Details

    • ENCODING

      public static final String ENCODING
      Name of the encoding connection property. Specifies charset encoding in text files.
      See Also:
    • EOL

      public static final String EOL
      Name of the eol connection property. EOL suffix. Default value is \n.
      See Also:
    • TRIM

      public static final String TRIM
      Name of the trim connection property. Value of true specifies that the leading and trailing whitespaces should be omitted.
      See Also:
    • FLUSH

      public static final String FLUSH
      Name of the flush connection property. Value of true specifies that the outputted content should flushed immediately after the <script> element completes.
      See Also:
    • SKIP_LINES

      public static final String SKIP_LINES
      Name of the skip_lines connection property. The number of lines to skip before start reading. Default value is 0 (no lines are skipped).

      Only valid for <query> elements.

      See Also:
    • NULL_STRING

      public static final String NULL_STRING
      Name of the null_string connection property. If set, specifies value of a string token to be parsed/formatted as Java null literal.
      See Also:
    • FORMAT_PREFIX

      public static final String FORMAT_PREFIX
      Prefix for properties containing a definition of the column format.
      See Also:
  • Constructor Details

    • AbstractTextConnection

      protected AbstractTextConnection()
      For testing only.
    • AbstractTextConnection

      protected AbstractTextConnection(DialectIdentifier dialectIdentifier, ConnectionParameters parameters)
      Initializes a text connection using specified properties.
      Parameters:
      dialectIdentifier -
      parameters -
    • AbstractTextConnection

      protected AbstractTextConnection(DialectIdentifier dialectIdentifier, TextConnectionParameters parameters)
  • Method Details

    • newOutputWriter

      protected Writer newOutputWriter() throws IOException
      Creates a new writer to send output to.
      Returns:
      writer for output.
      Throws:
      IOException - if IO error occured.
    • newInputReader

      protected Reader newInputReader() throws IOException
      Creates a new reader for input.
      Returns:
      reader for input.
      Throws:
      IOException - if IO error occured.
    • getConnectionParameters

      protected TextConnectionParameters getConnectionParameters()