On Wed, 27 Jul 2011 16:54:13 +0200 (CEST) mfortun@users.nuiton.org wrote: Merci de bien respecter les conventions de formattage (on en reparle lundi si tu veux) + ne pas mettre d'horribles String en dure c'est vilain (c'est pas de ton ressor, mais en le voyant il aurait été bien de créer les constantes qui vont bien en développeur consicencieux ;)) :(
Author: mfortun Date: 2011-07-27 16:54:13 +0200 (Wed, 27 Jul 2011) New Revision: 395
Url: http://nuiton.org/repositories/revision/processor/395
Log: * change static value to customizable value * add missing getter and setter for some attributes
Modified: trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java
Modified: trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java =================================================================== --- trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java 2011-06-07 20:09:19 UTC (rev 394) +++ trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java 2011-07-27 14:54:13 UTC (rev 395) @@ -94,6 +94,34 @@ return writeString; } + public void setWriteString(String writeString) { + this.writeString = writeString; + } + + public boolean isPassEmptyLine() { + return passEmptyLine; + } + + public void setPassEmptyLine(boolean passEmptyLine) { + this.passEmptyLine = passEmptyLine; + } + + public boolean isWriteParentheses() { + return writeParentheses; + } + + public void setWriteParentheses(boolean writeParentheses) { + this.writeParentheses = writeParentheses; + } + + public GeneratorTemplatesFilterIn getInFilter() { + return inFilter; + } + + public void setInFilter(GeneratorTemplatesFilterIn inFilter) { + this.inFilter = inFilter; + } + /** * methode appele lorsqu'on a la chaine entiere entre le header * et le footer.
Modified: trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java =================================================================== --- trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java 2011-06-07 20:09:19 UTC (rev 394) +++ trunk/nuiton-processor/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java 2011-07-27 14:54:13 UTC (rev 395) @@ -56,9 +56,65 @@ protected String endParenthese = EMPTY_STRING; + protected String endCar;
+ protected String stringDelim; + + protected String concacChar; + + public String getConcacChar() { + return concacChar; + } + + public void setConcacChar(String concacChar) { + this.concacChar = concacChar; + } + + public String getStringDelim() { + return stringDelim; + } + + public void setStringDelim(String stringDelim) { + this.stringDelim = stringDelim; + } + + public String getEndCar() { + return endCar; + } + + public void setEndCar(String endCar) { + this.endCar = endCar; + } + + public String getEndParenthese() { + return endParenthese; + } + + public void setEndParenthese(String endParenthese) { + this.endParenthese = endParenthese; + } + + public String getBeginParenthese() { + return beginParenthese; + } + + public void setBeginParenthese(String beginParenthese) { + this.beginParenthese = beginParenthese; + } + + public GeneratorTemplatesFilter getParent() { + return parent; + } + + public void setParent(GeneratorTemplatesFilter parent) { + this.parent = parent; + } + public GeneratorTemplatesFilterIn(GeneratorTemplatesFilter parent) { this.parent = parent; + endCar=";"; + stringDelim="\""; + concacChar="+"; }
/** @@ -72,16 +128,16 @@ protected String performInFilter(String ch) { if (parent.writeParentheses) { beginParenthese = "("; - endParenthese = ");"; + endParenthese = ")"+ endCar; } else { beginParenthese = EMPTY_STRING; endParenthese = EMPTY_STRING; } if (ch.startsWith("=")) { - return "\"+" + ch.substring(1) + "+\""; + return stringDelim + concacChar + ch.substring(1) + concacChar + stringDelim; } - return "\"" + endParenthese + ch + parent.getWriteString() + - beginParenthese + "\""; + return stringDelim + endParenthese + ch + parent.getWriteString() + + beginParenthese + stringDelim; }
/** @@ -106,15 +162,15 @@ protected String performOutFilter(String ch) { if (parent.writeParentheses) { beginParenthese = "("; - endParenthese = ");"; + endParenthese = ")"+ endCar; } else { beginParenthese = EMPTY_STRING; endParenthese = EMPTY_STRING; } String result = convertEndComment(ch).replaceAll("\"", "\\\\\"") .replaceAll("(\r\n|\n|\r)", - "\\\\n\"" + endParenthese + "\n" + - parent.getWriteString() + beginParenthese + "\""); + "\\\\n"+ stringDelim + endParenthese + "\n" + + parent.getWriteString() + beginParenthese + stringDelim); // it's important that \r\n is first in regexp. return result;
_______________________________________________ Processor-commits mailing list Processor-commits@list.nuiton.org http://list.nuiton.org/cgi-bin/mailman/listinfo/processor-commits
-- Tony Chemit -------------------- tél: +33 (0) 2 40 50 29 28 email: chemit@codelutin.com http://www.codelutin.com