Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/rxm.git

Beautification from command line.

AuthorDave Jarvis <email>
Date2015-03-16 10:17:20 GMT-0700
Commit50e194b4120bbc871e79590a665534d6cc2517a8
Parent2717de8
run.sh
#!/bin/bash
-java -jar build/libs/rxm.jar $1
+java -Drxm_beautify=true -jar build/libs/rxm.jar $1
+#java -jar build/libs/rxm.jar $1
source/java/com/whitemagicsoftware/rxm/QueryBuilder.java
String join = getJoinClause();
String where = getWhereClause();
- System.out.printf( "%s%nFROM%n%s%n%s%n%s%n",
+ System.out.printf( "%s%s%s%s",
select, from, join, where );
}
*/
private String getFromClause() {
- return " person person";
+ return "FROM person person";
}
source/java/com/whitemagicsoftware/rxm/tree/TransformationTree.java
*/
protected boolean beautify() {
- return true;
+ return Boolean.getBoolean( "rxm_beautify" );
}
source/java/com/whitemagicsoftware/rxm/tree/xml/SelectClauseTree.java
public String toString() {
- return String.format( "SELECT%s%s", getWhitespace(0), super.toString() );
+ String w = getWhitespace(0);
+ return String.format( "SELECT%s%s%s", w, super.toString(), w );
}
source/java/com/whitemagicsoftware/rxm/tree/xml/WhereClauseList.java
public String toString() {
+ String w = getWhitespace(0);
return getBranches().size() > 0 ?
- String.format( "WHERE%s%s", getWhitespace(), super.toString() ) :
+ String.format( "%sWHERE%s%s", w, getWhitespace(), super.toString() ) :
"";
}
Delta9 lines added, 6 lines removed, 3-line increase