Index: lutinprocessor/src/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java diff -u lutinprocessor/src/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java:1.12 lutinprocessor/src/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java:1.13 --- lutinprocessor/src/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java:1.12 Mon Aug 16 20:47:12 2004 +++ lutinprocessor/src/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java Mon May 30 13:22:48 2005 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ * - * Mise a jour: $Date: 2004/08/16 20:47:12 $ - * par : $Author: pineau $ + * Mise a jour: $Date: 2005/05/30 13:22:48 $ + * par : $Author: bpoussin $ */ package org.codelutin.processor.filters; @@ -37,60 +37,60 @@ */ public class GeneratorTemplatesFilterIn extends DefaultFilter { // GeneratorTemplatesFilterIn - GeneratorTemplatesFilter parent = null; + GeneratorTemplatesFilter parent = null; - public GeneratorTemplatesFilterIn(GeneratorTemplatesFilter parent) { - this.parent = parent; - } - - /** - * méthode appelée lorsqu'on a la chaîne entière entre le header et le - * footer. - * - * @param ch - * la chaîne trouvé - * @return ce qu'il faut écrire dans le fichier de sortie - */ - protected String performInFilter(String ch) { - if (ch.startsWith("=")) - return "\"+" + ch.substring(1) + "+\""; - return "\");" + ch + parent.getWriteString() + "(\""; - } - - /** - * Converti les fin de commentaire *) en fin normal de commentraire - */ - protected String convertEndComment(String ch) { - String result = ch.replaceAll("\\*\\)", "*/"); - return result; - } - - /** - * methode appele lorsqu'on a la chaine entiere a l'exterieur du - * header/footer - * - * @param ch - * la chaine trouve - * @return ce qu'il faut ecrire dans le fichier de sortie - */ - protected String performOutFilter(String ch) { - String result = convertEndComment(ch).replaceAll("\"", "\\\\\"") - .replaceAll("(\r\n|\n|\r)", - "\\\\n\");\n" + parent.getWriteString() + "(\""); - // it's important that \r\n is first in regexp. - - return result; - } - - /** la chaine du header */ - protected String getHeader() { - return "<%"; - } - - /** la chaine du footer */ - protected String getFooter() { - return "%>"; - } + public GeneratorTemplatesFilterIn(GeneratorTemplatesFilter parent) { + this.parent = parent; + } + + /** + * méthode appelée lorsqu'on a la chaîne entière entre le header et le + * footer. + * + * @param ch + * la chaîne trouvé + * @return ce qu'il faut écrire dans le fichier de sortie + */ + protected String performInFilter(String ch) { + if (ch.startsWith("=")) + return "\"+" + ch.substring(1) + "+\""; + return "\");" + ch + parent.getWriteString() + "(\""; + } + + /** + * Converti les fin de commentaire *) en fin normal de commentraire + */ + protected String convertEndComment(String ch) { + String result = ch.replaceAll("\\*\\)", "*/"); + return result; + } + + /** + * methode appele lorsqu'on a la chaine entiere a l'exterieur du + * header/footer + * + * @param ch + * la chaine trouve + * @return ce qu'il faut ecrire dans le fichier de sortie + */ + protected String performOutFilter(String ch) { + String result = convertEndComment(ch).replaceAll("\"", "\\\\\"") + .replaceAll("(\r\n|\n|\r)", + "\\\\n\");\n" + parent.getWriteString() + "(\""); + // it's important that \r\n is first in regexp. + + return result; + } + + /** la chaine du header */ + protected String getHeader() { + return "<%"; + } + + /** la chaine du footer */ + protected String getFooter() { + return "%>"; + } } // GeneratorTemplatesFilterIn