| Author | Dave Jarvis <email> |
|---|---|
| Date | 2015-03-16 00:13:50 GMT-0700 |
| Commit | 4a83eac05c3eff09e43ee253dcaf3f7371491f70 |
| Parent | 7169a09 |
| String join = getJoinClause(); | ||
| String where = getWhereClause(); | ||
| - System.out.printf( "SELECT%n%s%nFROM%n%s%n%s%nWHERE%n%s%n", | ||
| + System.out.printf( "%s%nFROM%n%s%n%s%n%s%n", | ||
| select, from, join, where ); | ||
| } |
| /** | ||
| + * Used by subclasses to beautify the leading SQL clause (e.g., SELECT, | ||
| + * FROM, WHERE). | ||
| + */ | ||
| + protected String getWhitespace( int spaces ) { | ||
| + return beautify() ? getNewline() + getIndent( spaces ) : " "; | ||
| + } | ||
| + | ||
| + /** | ||
| + * Helper method. | ||
| + */ | ||
| + protected String getWhitespace() { | ||
| + return getWhitespace( getIndentBy() ); | ||
| + } | ||
| + | ||
| + /** | ||
| * Creates a string of spaces that is spaces spaces long. | ||
| * |
| String e = element.getText(); | ||
| - String s = String.format( "XMLROOT( %s", startElement( e ) ); | ||
| + String s = String.format( "XMLROOT(%s", startElement( e ) ); | ||
| return new Token( s ); | ||
| } |
| } | ||
| + public String toString() { | ||
| + return String.format( "SELECT%s%s", getWhitespace(0), super.toString() ); | ||
| + } | ||
| + | ||
| /** | ||
| * Returns the transformed syntax for beginning the payload item. |
| super( payload ); | ||
| } | ||
| + | ||
| + public String toString() { | ||
| + return getBranches().size() > 0 ? | ||
| + String.format( "WHERE%s%s", getWhitespace(), super.toString() ) : | ||
| + ""; | ||
| + } | ||
| } | ||
| Delta | 27 lines added, 2 lines removed, 25-line increase |
|---|