## org.eclipse.datatools.modelbase.sql.query.util
Class SQLQuerySourceBuffer

    java.lang.Object
      org.eclipse.datatools.modelbase.sql.query.util.SQLQuerySourceBuffer

    public class SQLQuerySourceBuffer

extends java.lang.Object

Author:
  ckadner TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Method Summary
`SQLQuerySourceBuffer` `append(char c)`
`SQLQuerySourceBuffer` `append(int i)`
`SQLQuerySourceBuffer` `append(java.lang.String sql)`
`SQLQuerySourceBuffer` `appendIdentifier(java.lang.String ident)`
`SQLQuerySourceBuffer` `appendKeyword(java.lang.String keyword, boolean optional)`
`SQLQuerySourceBuffer` `appendOptional(char c)`
`SQLQuerySourceBuffer` `appendWord(java.lang.String word, boolean optional, boolean ignoreCase)`
`char` `charAt(int i)`
`void` `insertConditionalLineBreak(SQLQueryObject context)`
`int` `lastIndexOf(java.lang.String string)`
`int` `length()`
`SQLQuerySourceBuffer` `replace(int start, int end, java.lang.String str)`
`void` `setIndent(SQLQueryObject context)`
`void` `stripOriginalSourceCommentsAndBlanks_makeUpperCase_createIndexMapping()` strips out the comments of a SQL statement that are identified by two dashes in line "--" and that are not part of a delimited character string (single quotes), or SQL delimited object name (double quotes).
`java.lang.String` `toString()` returns a rather expensive snapshot of this SourceBuffer's content (non-Javadoc)

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### append

    public SQLQuerySourceBuffer append(java.lang.String sql)

  Parameters:
    `sql` -
  Returns:

### appendKeyword

    public SQLQuerySourceBuffer appendKeyword(java.lang.String keyword,
                                              boolean optional)

  Parameters:
    `keyword` -
    `optional` -
    `ignoreCase` -
  Returns:

### appendIdentifier

    public SQLQuerySourceBuffer appendIdentifier(java.lang.String ident)

  Parameters:
    `ident` -
    `optional` -
    `ignoreCase` -
  Returns:

### appendWord

    public SQLQuerySourceBuffer appendWord(java.lang.String word,
                                           boolean optional,
                                           boolean ignoreCase)

  Parameters:
    `word` -
    `optional` -
    `ignoreCase` -
  Returns:

### append

    public SQLQuerySourceBuffer append(char c)

  Parameters:
    `c` -
  Returns:

### appendOptional

    public SQLQuerySourceBuffer appendOptional(char c)

  Parameters:
    `c` -
  Returns:

### length

    public int length()

  Returns:

### replace

    public SQLQuerySourceBuffer replace(int start,
                                        int end,
                                        java.lang.String str)

  Parameters:
    `start` -
    `end` -
    `str` -
  Returns:

### toString

    public java.lang.String toString()

  returns a rather expensive snapshot of this SourceBuffer's content (non-Javadoc)

  Overrides:
    `toString` in class `java.lang.Object`
  See Also:
    `Object.toString()`

### stripOriginalSourceCommentsAndBlanks_makeUpperCase_createIndexMapping

    public void stripOriginalSourceCommentsAndBlanks_makeUpperCase_createIndexMapping()

  strips out the comments of a SQL statement that are identified by two dashes in line "--" and that are not part of a delimited character string (single quotes), or SQL delimited object name (double quotes).
  NOTE: The given SQL statement string must contain the line-break characters to delimit the "--" comments, otherwise all of the SQL-Statement that comes after the first occurence of a "--" comment be treated as part of the comment and rather be ignored, moreover the resulting statement is likely to fail!

  SELECT EMP_NUM FROM DEPARTEMENT -- pre-accumulated number of employees
  WHERE LOCATION = 'C-Tower--01' OR LOCATION = 'C-Tower-02'

  In this statement the first occurence of "--" would indicate a comment that would be stripped of and the second occurence would be retained, as it is part of a String delimited by the enclosing single quotes.

  Parameters:
    `statement` - A SQL statement.

### lastIndexOf

    public int lastIndexOf(java.lang.String string)

  Parameters:
    `string` -
  Returns:

### charAt

    public char charAt(int i)

  Parameters:
    `i` -
  Returns:

### append

    public SQLQuerySourceBuffer append(int i)

  Parameters:
    `i` -

### insertConditionalLineBreak

    public void insertConditionalLineBreak(SQLQueryObject context)

### setIndent

    public void setIndent(SQLQueryObject context)