}\r
\r
protected void prettyln(PrintWriter pw) {\r
- if(pretty)pw.println();\r
+ if (pretty)pw.println();\r
}\r
\r
public RT leaf(Mark mark, String tag, String ... args) {\r
back.append(tag);\r
back.append('>');\r
\r
- if(pretty) {\r
- if(mark!=null && mark.comment!=null) {\r
+ if (pretty) {\r
+ if (mark!=null && mark.comment!=null) {\r
int fi = forward.getIndent()*IndentPrintWriter.INDENT_MULTIPLIER;\r
- for(int i = fi+backSB.length();i<=COMMENT_COLUMN;++i) {\r
+ for (int i = fi+backSB.length();i<=COMMENT_COLUMN;++i) {\r
back.append(' ');\r
}\r
back.append("<!-- end ");\r
forward.append(" -->");\r
}\r
forward.inc();\r
- if(!oneLine) {\r
+ if (!oneLine) {\r
forward.println();\r
}\r
back.println();\r
}\r
- if(mark!=null)mark.spot = backStack.size();\r
+ if (mark!=null)mark.spot = backStack.size();\r
backStack.push(new Back(backSB.toString(),true, false));\r
backSB.setLength(0);\r
return (RT)this;\r
forward.append(tag);\r
addAttrs(attrs);\r
forward.append(" />");\r
- if(pretty) {\r
+ if (pretty) {\r
forward.println();\r
}\r
return (RT)this;\r
\r
@SuppressWarnings("unchecked")\r
public RT xml(String txt) {\r
- for(int i=0; i<txt.length();++i) {\r
+ for (int i=0; i<txt.length();++i) {\r
char c = txt.charAt(i);\r
switch(c) {\r
case '<':\r
\r
@SuppressWarnings("unchecked")\r
public RT textCR(int tabs, String txt) {\r
- for(int i=0;i<tabs;++i) {\r
+ for (int i=0;i<tabs;++i) {\r
forward.append(" ");\r
}\r
forward.append(txt);\r
- if(pretty)forward.println();\r
+ if (pretty)forward.println();\r
return (RT)this;\r
}\r
\r
int size = backStack.size();\r
Back c;\r
boolean println = false;\r
- for(int i=mark==null?0:mark.spot;i<size;++i) {\r
+ for (int i=mark==null?0:mark.spot;i<size;++i) {\r
c = backStack.pop();\r
- if(c.dec)forward.dec();\r
+ if (c.dec)forward.dec();\r
forward.append(c.str);\r
println = c.cr;\r
}\r
- if(pretty && println) {\r
+ if (pretty && println) {\r
forward.println();\r
}\r
return (RT)this;\r
public RT end() {\r
Mark mark = new Mark();\r
mark.spot=backStack.size()-1;\r
- if(mark.spot<0)mark.spot=0;\r
+ if (mark.spot<0)mark.spot=0;\r
return end(mark);\r
}\r
\r
public RT end(int i) {\r
Mark mark = new Mark();\r
mark.spot=backStack.size()-i;\r
- if(mark.spot<0)mark.spot=0;\r
+ if (mark.spot<0)mark.spot=0;\r
return end(mark);\r
}\r
\r
}\r
\r
protected void addAttrs(String[] attrs) {\r
- if(attrs!=null) {\r
- for(String attr : attrs) {\r
- if(attr!=null && attr.length()>0) {\r
+ if (attrs!=null) {\r
+ for (String attr : attrs) {\r
+ if (attr!=null && attr.length()>0) {\r
forward.append(' ');\r
String[] split = attr.split("=",2);\r
switch(split.length) {\r
\r
@SuppressWarnings("unchecked")\r
public RT comment(String string) {\r
- if(pretty) {\r
+ if (pretty) {\r
forward.print("<!-- ");\r
forward.print(string);\r
forward.println(" -->");\r