Class RowInstructionsImpl

java.lang.Object
org.csveed.row.RowInstructionsImpl
All Implemented Interfaces:
RowInstructions

public class RowInstructionsImpl extends Object implements RowInstructions
The Class RowInstructionsImpl.
  • Constructor Details

    • RowInstructionsImpl

      public RowInstructionsImpl()
  • Method Details

    • logSettings

      public void logSettings()
      Log settings.
    • getSymbolMapping

      public SymbolMapping getSymbolMapping()
      Gets the symbol mapping.
      Returns:
      the symbol mapping
    • isSkipEmptyLines

      public boolean isSkipEmptyLines()
      Checks if is skip empty lines.
      Returns:
      true, if is skip empty lines
    • isUseHeader

      public boolean isUseHeader()
      Description copied from interface: RowInstructions
      Checks to see if a header must be used for the table.
      Specified by:
      isUseHeader in interface RowInstructions
      Returns:
      true if a header must be used
    • setUseHeader

      public RowInstructions setUseHeader(boolean useHeader)
      Description copied from interface: RowInstructions
      Makes sure that the first readable line is interpreted as the header line. That line will not be read as content. This method is called whenever CsvFile.useHeader() is used. The default value for this setting is true.
      Specified by:
      setUseHeader in interface RowInstructions
      Parameters:
      useHeader - true if the header is interpreted and used
      Returns:
      convenience for chaining
    • setStartRow

      public RowInstructions setStartRow(int startRow)
      Description copied from interface: RowInstructions
      Sets the start row of the CSV file. If RowInstructions.setUseHeader(boolean) == true, this will be the header row and the next ones are all content rows. This method is called whenever CsvFile.startRow() is used. The default value for this setting is 0.
      Specified by:
      setStartRow in interface RowInstructions
      Parameters:
      startRow - the first row to start reading, including the header row
      Returns:
      convenience for chaining
    • getEscape

      public char getEscape()
      Description copied from interface: RowInstructions
      Returns the escape character to use for writing a cell.
      Specified by:
      getEscape in interface RowInstructions
      Returns:
      the escape character
    • setEscape

      public RowInstructions setEscape(char symbol)
      Description copied from interface: RowInstructions
      Sets the character that will be interpreted as an escape symbol while within a quoted field. This method is called whenever CsvFile.escape() is used. The default value for this setting is a double quote (") symbol.
      Specified by:
      setEscape in interface RowInstructions
      Parameters:
      symbol - the symbol to use for escaping characters within a quoted field
      Returns:
      convenience for chaining
    • getQuote

      public char getQuote()
      Description copied from interface: RowInstructions
      Returns the character that will be used when writing quote characters.
      Specified by:
      getQuote in interface RowInstructions
      Returns:
      character used to represent quote characters
    • setQuotingEnabled

      public RowInstructions setQuotingEnabled(boolean quoteFields)
      Description copied from interface: RowInstructions
      Sets whether or not quotes are written around the field values. If enabled, the character set as the escape symbol will be disabled. If disabled, no quotes are written around the field values and the escape symbol is not escaped. This setting has no effect when reading CSV files, only when writing them.
      Specified by:
      setQuotingEnabled in interface RowInstructions
      Parameters:
      quoteFields - whether or not to put quotes around fields
      Returns:
      convenience for chaining
    • getQuotingEnabled

      public boolean getQuotingEnabled()
      Description copied from interface: RowInstructions
      Returns whether or not quotes around fields are enabled.
      Specified by:
      getQuotingEnabled in interface RowInstructions
      Returns:
      true if quotes are enabled
    • setQuote

      public RowInstructions setQuote(char symbol)
      Description copied from interface: RowInstructions
      Sets the character that will be interpreted as a quote symbol, signifying either the start or the end of a quoted field. This method is called whenever CsvFile.quote() is used. The default value for this setting is a double quote (") symbol.
      Specified by:
      setQuote in interface RowInstructions
      Parameters:
      symbol - the symbol to use for indicating start/end of a quoted field
      Returns:
      convenience for chaining
    • getSeparator

      public char getSeparator()
      Description copied from interface: RowInstructions
      Gets the character that will be used when writing separators.
      Specified by:
      getSeparator in interface RowInstructions
      Returns:
      character used to represent separator characters
    • setSeparator

      public RowInstructions setSeparator(char symbol)
      Description copied from interface: RowInstructions
      Sets the character that will be interpreted as a separator between cells. This method is called whenever CsvFile.separator() is used. The default value for this setting is a semi-colon (;).
      Specified by:
      setSeparator in interface RowInstructions
      Parameters:
      symbol - the symbol to use as a separator between cells
      Returns:
      convenience for chaining
    • setComment

      public RowInstructions setComment(char symbol)
      Description copied from interface: RowInstructions
      Sets the character that will be interpreted as a comment field on the first position of a row. This method is called whenever CsvFile.comment() is used. The default value for this setting is a hashtag (#).
      Specified by:
      setComment in interface RowInstructions
      Parameters:
      symbol - the symbol to use as the 0-position comment marker
      Returns:
      convenience for chaining
    • getEndOfLine

      public char[] getEndOfLine()
      Description copied from interface: RowInstructions
      Gets the characters that will be used when writing End-of-line separators.
      Specified by:
      getEndOfLine in interface RowInstructions
      Returns:
      the EOL characters
    • setEndOfLine

      public RowInstructions setEndOfLine(char[] symbols)
      Description copied from interface: RowInstructions
      Sets the characters (plural) that will be interpreted as end-of-line markers (unless within a quoted field). This method is called whenever CsvFile.endOfLine() is used. The default values for this setting are \r and \n
      Specified by:
      setEndOfLine in interface RowInstructions
      Parameters:
      symbols - the symbol to interpret as end-of-line markers (unless within a quoted field)
      Returns:
      convenience for chaining
    • skipEmptyLines

      public RowInstructions skipEmptyLines(boolean skip)
      Description copied from interface: RowInstructions
      Determines whether empty lines must be skipped or treated as single-column rows. This method is called whenever CsvFile.skipEmptyLines() is used. The default value for this setting is to skip the empty lines.
      Specified by:
      skipEmptyLines in interface RowInstructions
      Parameters:
      skip - true to skip empty lines, false to treat as single-column rows
      Returns:
      convenience for chaining
    • skipCommentLines

      public RowInstructions skipCommentLines(boolean skip)
      Description copied from interface: RowInstructions
      Determines whether comment lines must be skipped. This method is called whenever CsvFile.skipCommentLines() is used. The default value for this setting is to skip comment lines. This method exists to guarantee that lines are not accidentally treated as comment lines.
      Specified by:
      skipCommentLines in interface RowInstructions
      Parameters:
      skip - true to skip comment lines, identified as starting with a comment marker
      Returns:
      convenience for chaining