Processor-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
May 2009
- 1 participants
- 47 discussions
[Lutinprocessor-commits] r204 - in nuitonprocessor/trunk: . src/main/java/org/codelutin/processor src/main/java/org/codelutin/processor/ant src/main/java/org/codelutin/processor/filters src/main/java/org/nuiton src/main/java/org/nuiton/processor src/main/java/org/nuiton/processor/ant src/main/java/org/nuiton/processor/filters
by tchemit@users.labs.libre-entreprise.org 13 May '09
by tchemit@users.labs.libre-entreprise.org 13 May '09
13 May '09
Author: tchemit
Date: 2009-05-13 16:41:38 +0000 (Wed, 13 May 2009)
New Revision: 204
Added:
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/GeneratorTemplatesProcessor.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/I18nExtractor.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LicenseProcessor.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LogsProcessor.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/OptimisationProcessor.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/Processor.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorReader.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorWriter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/I18nExtractorTask.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/ProcessorTask.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/ActiveLogsCodeFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/DefaultFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/Filter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/I18nFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LicenseFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LogsFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/NoActionFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/OptimisationFilter.java
nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/RemoveLogsCodeFilter.java
Removed:
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/GeneratorTemplatesProcessor.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/I18nExtractor.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LicenseProcessor.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LogsProcessor.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/OptimisationProcessor.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/Processor.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorReader.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorWriter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/I18nExtractorTask.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/ProcessorTask.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/ActiveLogsCodeFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/DefaultFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/Filter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/I18nFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LicenseFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LogsFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/NoActionFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/OptimisationFilter.java
nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/RemoveLogsCodeFilter.java
Modified:
nuitonprocessor/trunk/pom.xml
Log:
migrate to nuiton
Modified: nuitonprocessor/trunk/pom.xml
===================================================================
--- nuitonprocessor/trunk/pom.xml 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/pom.xml 2009-05-13 16:41:38 UTC (rev 204)
@@ -50,7 +50,7 @@
<properties>
- <nuiton.project>nuitonprocessor</nuiton.project>
+ <redmine.project>nuitonprocessor</redmine.project>
<!-- assuprimer du de l'utilisation de mavenpom -->
<labs.id>28</labs.id>
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/GeneratorTemplatesProcessor.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/GeneratorTemplatesProcessor.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/GeneratorTemplatesProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,59 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
- * GeneratorTemplatesProcessor.java
- *
- * Created: Wed Sep 4 2002
- *
- * @author <pineau(a)codelutin.com>
- * Copyright Code Lutin
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-
-package org.codelutin.processor;
-
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.codelutin.processor.filters.GeneratorTemplatesFilter;
-
-public class GeneratorTemplatesProcessor extends Processor {
-
- public GeneratorTemplatesProcessor(){
- setInputFilter(new GeneratorTemplatesFilter());
- }
-
- static public void process(String filein, String fileout)
- throws IOException{
- Processor processor = new GeneratorTemplatesProcessor();
- processor.process(new FileReader(filein), new FileWriter(fileout));
- }
-
- public static void main(String [] args)throws IOException{
- if(args.length < 2) {
- System.out.println("Give source and destination file");
- System.exit(1);
- } else {
- process(args[0], args[1]);
- }
- }
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/I18nExtractor.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/I18nExtractor.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/I18nExtractor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,120 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
- * I18nExtractor.java
- *
- * Created: Aug 16, 2004
- *
- * @author Cédric Pineau <pineau(a)codelutin.com>
- * @version $Revision$
- *
- * Last update : $Date$
- * by : $Author$
- */
-
-package org.codelutin.processor;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.codelutin.processor.filters.I18nFilter;
-
-/**
- *
- */
-public class I18nExtractor {
-
- protected I18nFilter filter = new I18nFilter();
-
- protected HashMap i18nStringsMap = new HashMap();
-
- public void extract(File[] srcFiles, File outputFile) throws IOException {
- PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8")));
- for (int i = 0; i < srcFiles.length; i++) {
- processFile(srcFiles[i]);
- }
- for (Iterator iter = i18nStringsMap.keySet().iterator(); iter.hasNext();) {
- String i18nString = (String) iter.next();
- List locations = (List) i18nStringsMap.get(i18nString);
- for (Iterator iterator = locations.iterator(); iterator.hasNext();) {
- String location = (String) iterator.next();
- writer.println("# "+location);
- }
- writer.println(i18nString+"=");
- }
- writer.close();
- }
-
- protected void processFile(File srcFile) throws IOException {
- LineNumberReader lnr = new LineNumberReader(new InputStreamReader(new FileInputStream(srcFile), "UTF-8"));
- while (lnr.ready()) {
- String line = lnr.readLine();
- int lineNumber = lnr.getLineNumber();
- processLine(line, srcFile, lineNumber);
- }
- }
-
- protected void processLine(String line, File srcFile, int lineNumber) {
- String i18nStringsSet = filter.parse(line);
- if (i18nStringsSet != I18nFilter.EMPTY_STRING) {
- // Found a set of i18n Strings, split it.
- String[] i18nStrings = i18nStringsSet.split("=");
- for (int i = 0; i < i18nStrings.length; i++) {
- String i18nString = i18nStrings[i];
-
- List locations = (List) i18nStringsMap.get(i18nString);
- if (locations == null) {
- locations = new ArrayList();
- i18nStringsMap.put(i18nString, locations);
- }
- locations.add(srcFile.getPath()+"("+lineNumber+")");
- }
- }
- }
-
- public static void main(String[] args) {
- if(args.length < 2) {
- System.out.println("Please give at least sources and destination file");
- System.exit(0);
- } else if (args.length > 2) {
- File[] sources = new File[args.length-1];
- for (int i = 0; i < args.length-1; i++) {
- sources[i] =new File(args[i]);
- }
- File destination = new File(args[args.length-1]);
- try {
- new I18nExtractor().extract(sources, destination);
- } catch (IOException eee) {
- java.util.logging.Logger.getLogger("org.codelutin.processor.I18nExtractor.").severe("Error during i18n extraction : "+eee);
- System.out.println("!!! "+eee); // TODO remove this
- }
- }
-
- }
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LicenseProcessor.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LicenseProcessor.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LicenseProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,46 +0,0 @@
-/**
- * *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. *##%
- */
-package org.codelutin.processor;
-
-import org.codelutin.processor.filters.LicenseFilter;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-
-/** @author chemit */
-public class LicenseProcessor extends org.codelutin.processor.Processor {
-
- protected LicenseFilter licenseFilter;
-
- public LicenseProcessor(String header) {
- licenseFilter = new LicenseFilter(header);
- setInputFilter(licenseFilter);
- }
-
- public LicenseFilter getLicenceFilter() {
- return licenseFilter;
- }
-
- public void process(File filein, File fileout) throws IOException {
- process(new FileReader(filein), new FileWriter(fileout));
- }
-}
-
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LogsProcessor.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LogsProcessor.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LogsProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,88 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* LogsProcessor.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor;
-
-import org.codelutin.processor.filters.*;
-import java.io.*;
-
-/*
-* This class is a processor for source logs
-*/
-public class LogsProcessor extends Processor {
-
- /** Type of actions */
- protected static class Action {}
- /** Do nothing */
- public final static Action NoAction = new Action();
-
- /** Active logs in output. This is the default action */
- public final static Action Logs = new Action();
- /** Remove logs in output */
- public final static Action NoLogsCode = new Action();
-
- /** Constructor */
- public LogsProcessor (Action action) {
- if (action == NoAction) {
- // No action is the default filter in Processor
- } else if (action == NoLogsCode) {
- setInputFilter(new RemoveLogsCodeFilter());
- } else {
- // Go for logs
- setInputFilter(new ActiveLogsCodeFilter());
- }
- }
-
- public static void main(String [] args) throws Exception {
- LogsProcessor processor;
- if(args.length < 2) {
- System.out.println("Give source and destination file, then action");
- System.out.println("Action may be remove or active (default is no action)");
- System.exit(0);
- } else if (args.length > 2) {
- if (args[2].equals("remove")) {
- processor = new LogsProcessor(NoLogsCode);
- System.out.println("Removing logs code");
- } else if (args[2].equals("active")) {
- processor = new LogsProcessor(Logs);
- System.out.println("Setting logs active");
- } else {
- processor = new LogsProcessor(NoAction);
- System.out.println("No action taken");
- }
- try {
- processor.process(new FileReader(args[0]),
- new FileWriter(args[1]));
- } catch (IOException eee) {
- java.util.logging.Logger.getLogger("org.codelutin.processor.LogsProcessor.").severe("Error during log processing: "+eee);
- }
- }
- }
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/OptimisationProcessor.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/OptimisationProcessor.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/OptimisationProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,57 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* OptimisationProcessor.java
-*
-* Created: Wed Sep 4 2002
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor;
-
-import java.io.*;
-import org.codelutin.processor.filters.OptimisationFilter;
-
-public class OptimisationProcessor extends Processor { // OptimisationProcessor
-
- public OptimisationProcessor(){
- setInputFilter(new OptimisationFilter());
- }
-
- static public void process(String filein, String fileout)
- throws IOException{
- Processor processor = new OptimisationProcessor();
- processor.process(new FileReader(filein), new FileWriter(fileout));
- }
-
- public static void main(String [] args)throws IOException{
- if(args.length < 2) {
- System.out.println("Give source and destination file");
- System.exit(1);
- } else {
- process(args[0], args[1]);
- }
- }
-
-} // OptimisationProcessor
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/Processor.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/Processor.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/Processor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,92 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* Processor.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor;
-
-import org.codelutin.processor.filters.*;
-import org.codelutin.processor.filters.Filter;
-import java.io.*;
-import java.util.logging.Logger;
-
-/*
-* This class is a generic sources processor
-* Given a reader class name and a writer class name
-*/
-public class Processor {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Logger log = Logger.getLogger("org.codelutin.processor.Processor");
-
- protected Filter [] inputFilter = new Filter[]{new NoActionFilter()};
- protected Filter outputFilter = new NoActionFilter();
-
- public Processor(){}
- public Processor(Filter [] filters){
- setInputFilter(filters);
- }
-
- public void setInputFilter(Filter inFilter){
- setInputFilter(new Filter[]{inFilter});
- }
- public void setInputFilter(Filter [] inFilter){
- inputFilter = inFilter;
- }
- public void setOutputFilter(Filter outFilter){
- outputFilter = outFilter;
- }
-
- protected BufferedReader getReader(Reader externalInput){
- BufferedReader result = new BufferedReader(externalInput);
- for(int i=0; i<inputFilter.length; i++){
- result = new ProcessorReader(result, inputFilter[i]);
- }
- return result;
- }
-
- /** Process all available data */
- public void process (Reader externalInput, Writer externalOutput) throws IOException {
- log.finest("Debug du process");
- BufferedReader input = getReader(externalInput);
- ProcessorWriter output =
- new ProcessorWriter(new BufferedWriter(externalOutput), outputFilter);
-
- log.finest("input: " + input);
- log.finest("output: " + output);
-
- String line = input.readLine();
- while (line != null) {
- log.finest("Ligne lu: " + line);
- output.writeLine(line);
- line = input.readLine();
- }
- output.flush();
- }
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorReader.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorReader.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorReader.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,95 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* ProcessorReader.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.StringReader;
-
-import org.codelutin.processor.filters.Filter;
-
-public class ProcessorReader extends BufferedReader {
-
- protected BufferedReader input;
- protected Filter filter;
- protected String lineSeparator;
-
- protected ProcessorReader(){
- super(new StringReader(""));
- }
-
- public ProcessorReader(BufferedReader input, Filter filter) {
- this();
- setInput(input);
- this.filter = filter;
- lineSeparator = System.getProperty("line.separator");
- }
-
- public void setInput(BufferedReader input){
- this.input = input;
- }
-
- public boolean markSupported(){
- return false;
- }
-
- public String readLine() throws IOException {
- if (input.ready()) {
- String line = input.readLine();
- if(line != null){
- if (!(input instanceof ProcessorReader)){
- line += lineSeparator;
- }
- return filter.parse(line);
- }
- }
- if(filter.hasCachedData()){
- return filter.flush();
- } else {
- return null;
- }
- }
-
- public boolean ready() {
- try {
- boolean ready = input.ready();
- if (ready) return true;
- return filter.hasCachedData();
- } catch (IOException eee) {
- return false;
- }
- }
-
- public void close() throws IOException {
- input.close();
- }
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorWriter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorWriter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorWriter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,64 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/**
-* ProcessorWriter.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor;
-
-import org.codelutin.processor.filters.*;
-import java.io.*;
-
-public class ProcessorWriter {
-
- protected BufferedWriter output;
- protected Filter filter;
-
- public ProcessorWriter(BufferedWriter output, Filter filter) {
- this.output = output;
- this.filter = filter;
- }
-
- public void writeLine(String line) throws IOException {
-
- // TODO Euh on se sert quand du filtre de sortie ???? :-)
- output.write(line);
- }
-
- public void newLine() throws IOException {
- output.newLine();
- }
-
- public void flush() throws IOException {
- output.flush();
- }
-
- public void close() throws IOException {
- output.close();
- }
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/I18nExtractorTask.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/I18nExtractorTask.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/I18nExtractorTask.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,151 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2009 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-package org.codelutin.processor.ant;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.MatchingTask;
-import org.codelutin.processor.I18nExtractor;
-
-/**
- * I18nExtractorTask.
- *
- * Created: Aug 16, 2004
- *
- * @author Cédric Pineau <pineau(a)codelutin.com>
- * @version $Revision$
- *
- * Last update : $Date$
- * by : $Author$
- */
-public class I18nExtractorTask extends MatchingTask {
-
- public static final int MSG_VERBOSE = Project.MSG_VERBOSE;
-
- protected File srcDir;
-
- protected File destFile;
-
- protected String[] includes = new String[] {};
-
- protected String[] excludes = new String[] {};
-
- protected String[] srcFileNames;
-
- public I18nExtractorTask() {
-
- }
-
- protected void doExecute() throws BuildException {
- // creation du repertoire pour le fichier destination
- destFile.getParentFile().mkdirs();
- List<File> fileList = new ArrayList<File>();
- for (int i = 0; i < srcFileNames.length; i++) {
- fileList.add(new File(srcFileNames[i]));
- }
- try {
- new I18nExtractor()
- .extract(fileList.toArray(new File[0]), destFile);
- } catch (IOException eee) {
- throw new BuildException(eee);
- }
- }
-
- public void setSrcdir(File srcDir) {
- this.srcDir = srcDir;
- }
-
- public void setDestFile(File destFile) {
- this.destFile = destFile;
- }
-
- public void execute() throws BuildException {
- // first of all, make sure that we've got a srcdir
- if (srcDir == null) {
- throw new BuildException("srcdir attribute must be set!",
- getLocation());
- }
- if (!srcDir.exists()) {
- throw new BuildException("srcdir \"" + srcDir.getPath()
- + "\" does not exist!", getLocation());
- }
-
- if (destFile == null) {
- throw new BuildException("destFile attribute must be set!",
- getLocation());
- }
-
- // Build the list of files to compute
- buildFileList();
-
- // generate the source files
- doExecute();
- }
-
- protected void buildFileList() {
-
- // Obtain this list of files within the source directory
- DirectoryScanner ds = getDirectoryScanner(srcDir);
-
- String[] includes = getIncludes();
- if (includes.length > 0) {
- ds.setIncludes(includes);
- }
- String[] excludes = getExcludes();
- if (excludes.length > 0) {
- ds.setExcludes(excludes);
- }
-
- ds.scan();
-
- // on met le resultat dans files
- srcFileNames = ds.getIncludedFiles();
- }
-
- protected boolean isNewer(String filein, String fileout) {
- boolean result = new File(filein).lastModified() > new File(fileout)
- .lastModified();
- if (result) {
- log(filein + " is newer than " + fileout, MSG_VERBOSE);
- }
- return result;
- }
-
- protected String[] getExcludes() {
- return excludes;
- }
-
- protected String[] getIncludes() {
- return includes;
- }
-
- public void setIncludes(String includes) {
- this.includes = includes.split(",");
- }
-
- public void setExcludes(String excludes) {
- this.excludes = excludes.split(",");
- }
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/ProcessorTask.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/ProcessorTask.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/ProcessorTask.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,243 +0,0 @@
-/*
- * *##% Lutin file processor
- * Copyright (C) 2002 - 2009 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
- */
-
-package org.codelutin.processor.ant;
-
-import java.io.File;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.MatchingTask;
-import org.codelutin.processor.Processor;
-import org.codelutin.processor.filters.Filter;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-
-/**
- * Tache ant pour lutinprocessor.
- *
- * To use this task, put this code in ant build file:
- *
- * <taskdef name="processor" classname="org.codelutin.processor.ant.ProcessorTask"
- * classpath="lib/lutinprocessor.jar" />
- *
- * and use it with:
- *
- * <processor srcdir="${src}" destdir="${targetgen}" filters="org.codelutin.processor.filters.GeneratorTemplatesFilter" />
- *
- * Created: 14 janv. 2004
- *
- * @author Benjamin Poussin <poussin(a)codelutin.com> Copyright Code Lutin
- *
- * @version $Revision$
- *
- * Mise a jour: $Date$ par : $Author$
- */
-public class ProcessorTask extends MatchingTask { // ProcessorTask
-
- public static final int MSG_VERBOSE = Project.MSG_VERBOSE;
-
- protected File srcDir;
-
- protected File destDir;
-
- protected String[] includes = new String[] {};
-
- protected String[] excludes = new String[] {};
-
- protected String[] files;
-
- protected String fileInPattern = "";
-
- protected String fileOutPattern = "";
-
- protected String filters = "org.codelutin.processor.filters.NoActionFilter";
-
- protected boolean overwrite = true;
-
- protected boolean verbose = false;
-
- public ProcessorTask() {
-
- }
-
- public void setVerbose(boolean verbose) {
- this.verbose = verbose;
- }
-
- public void setOverwrite(boolean overwrite) {
- this.overwrite = overwrite;
- }
-
- public void setFileOutPattern(String fileOutPattern) {
- this.fileOutPattern = fileOutPattern;
- }
-
- public void setFileInPattern(String fileInPattern) {
- this.fileInPattern = fileInPattern;
- }
-
- public void setSrcdir(File srcDir) {
- this.srcDir = srcDir;
- }
-
- public void setDestdir(File destDir) {
- this.destDir = destDir;
- }
-
- public void setFilters(String filters) {
- this.filters = filters;
- }
-
- protected String applyTransformationFilename(String filename) {
- return filename.replaceAll(fileInPattern, fileOutPattern);
- }
-
- protected void doExecute() throws BuildException {
- Processor processor = new Processor(getFilters());
- int numberFiles;
- for (numberFiles = 0; numberFiles < files.length; numberFiles++) {
- String inputFileName = absoluteSourceName(files[numberFiles]);
- String outputFileName = absoluteDestinationName(applyTransformationFilename(files[numberFiles]));
- if (verbose) {
- log("Using " + inputFileName);
- }
- if (overwrite || isNewer(inputFileName, outputFileName)) {
- if (verbose) {
- log("Generating " + outputFileName);
- }
- // creation du repertoire pour le fichier destination
- new File(outputFileName).getParentFile().mkdirs();
- try {
- processor.process(new FileReader(inputFileName),
- new FileWriter(outputFileName));
- } catch (IOException eee) {
- throw new BuildException(eee);
- }
- }
- }
- log("Generating " + numberFiles + " files to " + destDir);
- }
-
- protected Filter[] getFilters() throws BuildException {
- String[] filterList = filters.split(",");
- Filter[] result = new Filter[filterList.length];
- for (int i = 0; i < filterList.length; i++) {
- try {
- // Class.forName semble fonctionner maintenant
- // avant il fallait utiliser getClass().forName
- result[i] = (Filter) Class.forName(filterList[i].trim())
- .newInstance();
- } catch (Exception eee) {
- throw new BuildException("Error during looking for '"
- + filterList[i].trim() + "' class", eee);
- }
- }
- return result;
- }
-
- public void execute() throws BuildException {
- // first of all, make sure that we've got a srcdir
- if (srcDir == null) {
- throw new BuildException("srcdir attribute must be set!",
- getLocation());
- }
- if (!srcDir.exists()) {
- throw new BuildException("srcdir \"" + srcDir.getPath()
- + "\" does not exist!", getLocation());
- }
-
- if (destDir == null) {
- destDir = srcDir;
- }
- if (!destDir.isDirectory()) {
- throw new BuildException("destination directory \"" + destDir
- + "\" does not exist or is not a directory", getLocation());
- }
-
- // Build the list of files to compute
- buildFileList();
-
- // generate the source files
- doExecute();
- }
-
- protected void buildFileList() {
-
- // Obtain this list of files within the source directory
- DirectoryScanner ds = getDirectoryScanner(srcDir);
-
- String[] includes = getIncludes();
- if (includes.length > 0) {
- ds.setIncludes(includes);
- }
- String[] excludes = getExcludes();
- if (excludes.length > 0) {
- ds.setExcludes(excludes);
- }
-
- ds.scan();
-
- // on recherche ceux que l'on doit vraiment refaire
- files = ds.getIncludedFiles();
- }
-
- protected boolean isNewer(String filein, String fileout) {
- boolean result = new File(filein).lastModified() > new File(fileout)
- .lastModified();
- if (result) {
- log(filein + " is newer than " + fileout, MSG_VERBOSE);
- }
- return result;
- }
-
- protected String[] getExcludes() {
- return excludes;
- }
-
- protected String[] getIncludes() {
- return includes;
- }
-
- public void setIncludes(String[] includes) {
- this.includes = includes;
- }
-
- public void setIncludes(String includes) {
- setIncludes(includes.split(","));
- }
-
- public void setExcludes(String[] excludes) {
- this.excludes = excludes;
- }
-
- public void setExcludes(String excludes) {
- setExcludes(excludes.split(","));
- }
-
- protected String absoluteDestinationName(String fileName) {
- return destDir.getPath() + File.separator + fileName;
- }
-
- protected String absoluteSourceName(String fileName) {
- return srcDir.getPath() + File.separator + fileName;
- }
-
-} // ProcessorTask
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/ActiveLogsCodeFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/ActiveLogsCodeFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/ActiveLogsCodeFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,62 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* x*
-* ActiveLogsCodeFilter.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor.filters;
-
-/*
-* This class deals with the
-*/
-public class ActiveLogsCodeFilter extends LogsFilter {
-
- /**
- * methode appele lorsqu'on a la chaine entiere entre le header
- * et le footer.
- * @param ch la chaine trouve
- * @return ce qu'il faut ecrire dans le fichier de sortie
- */
- protected String performInFilter(String ch){
- // Logs must be performed within a try{...}catch{} bloc
- return
- "try {" +
- ch +
- "} catch (Exception logsE) { System.err.println(\"Error in Logging instructions\"); logsE.printStackTrace(); }";
- }
-
- /**
- * 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){
- return ch;
- }
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/DefaultFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/DefaultFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/DefaultFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,144 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/*******************************************************************************
- * DefaultFilter.java
- *
- * Created: Wed Sep 4 2002
- *
- * @author <poussin(a)codelutin.com>Copyright Code Lutin
- *
- * @version $Revision$
- *
- * Mise a jour: $Date$ par : $Author$
- */
-
-package org.codelutin.processor.filters;
-
-public abstract class DefaultFilter implements Filter { // DefaultFilter
-
- public static int NOT_FOUND = -1;
-
- protected StringBuffer cachedContent = new StringBuffer();
-
- public DefaultFilter() {
-
- }
-
- /** Type of states */
- protected static class State {
- /** Looking-for-header state */
- public final static State SEARCH_HEADER = new State();
-
- /** Looking-for-footer state */
- public final static State SEARCH_FOOTER = new State();
- }
-
- protected State currentState = State.SEARCH_HEADER;
-
- public String parse(String input) {
- int matchingIndex;
-
- // add new input to current content
- cachedContent.append(input);
- String content = cachedContent.toString();
-
- if (currentState.equals(State.SEARCH_HEADER)) {
- // Looking for a header
- matchingIndex = getMatchIndexFor(content, getHeader());
- if (matchingIndex != NOT_FOUND) {
- // Header found, return "out" part of it + recursive process of remaining chars
- currentState = State.SEARCH_FOOTER;
- cachedContent.setLength(0);
- return performOutFilter(content.substring(0, matchingIndex))
- + parse(content.substring(matchingIndex));
- }
- // No header found !
- return EMPTY_STRING;
- }
-
- if (currentState.equals(State.SEARCH_FOOTER)) {
- // Looking for a footer
- matchingIndex = getMatchIndexFor(content, getFooter());
- if (matchingIndex != NOT_FOUND) {
- // Footer found, return "in" part of it + recursive process of remaining chars
- currentState = State.SEARCH_HEADER;
- cachedContent.setLength(0);
- int matchingEndIndex = matchingIndex + getMatchLengthFor(getFooter());
- return performInFilter(performHeaderFooterFilter(content.substring(0, matchingEndIndex)))
- + parse(content.substring(matchingEndIndex));
- }
- // No footer found !
- return EMPTY_STRING;
- }
-
- return "INVALID STATE in DefaultFilter !";
- }
-
- public String performHeaderFooterFilter(String ch) {
- return ch.substring(getHeader().length(), ch.length()-getFooter().length());
- }
-
- public int getMatchIndexFor(String input, String sequence) {
- return input.indexOf(sequence);
- }
-
- public int getMatchLengthFor(String sequence) {
- return sequence.length();
- }
-
- public boolean hasCachedData() {
- return (cachedContent.length() > 0);
- }
-
- public String flush() {
- String line = cachedContent.toString();
- // Empty the cache,
- cachedContent.setLength(0);
- // and returns its content
- if (currentState.equals(State.SEARCH_HEADER))
- return performOutFilter(line);
- return performInFilter(line);
- }
-
- /**
- * methode appele lorsqu'on a la chaine entiere entre le header et le
- * footer.
- *
- * @param ch
- * la chaine trouve
- * @return ce qu'il faut ecrire dans le fichier de sortie
- */
- abstract protected String performInFilter(String ch);
-
- /**
- * 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
- */
- abstract protected String performOutFilter(String ch);
-
- /** la chaine du header */
- abstract protected String getHeader();
-
- /** la chaine du footer */
- abstract protected String getFooter();
-
-} // DefaultFilter
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/Filter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/Filter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/Filter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,41 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* Filter.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor.filters;
-
-public interface Filter {
-
- public final static String EMPTY_STRING = "";
-
- public String parse (String input);
- public boolean hasCachedData();
- public String flush ();
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,139 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
- * GeneratorTemplatesFilter.java
- *
- * Created: Wed Sep 4 2002
- *
- * @author <pineau(a)codelutin.com>
- * Copyright Code Lutin
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-
-/**
- * MultilinesLitteralsFilter.java
- */
-
-package org.codelutin.processor.filters;
-
-/*
- * Classe principale du filtre de génération. Ce filtre recherche tout ce qu'il
- * y a entre les tag /*{ et }*/ a l'interieur de ces tags un autre filtre
- * ({@link org.codelutin.processor.filters.GeneratorTemplatesFilterIn}) est
- * utilisé pour générer les tags <% %>, <%= %> et *).
- * <ul>
- * <li>/*{ et }*/ est remplacer par output.write("..."); pour chaque
- * ligne et les " sont coté</li>
- * <li><% %></li>
- * <li><%= %></li>
- * <li>*) permet de fermer un commentaire sans le fermer réeellement, cela
- * permet au éditeur faisant une analyse du code de continuer a fonctionner
- * ce tag est remplacé par son equivalent */ après génération.</li>
- * </ul>
- * Vous pouvez modifier le comportement du processor en mettant des options
- * Une option est incluse dans le tag et est de la forme
- * /*{generator option: <optionName> = valeur}*/
- * les options existantes sont:
- * <li>passEmptyLine: boolean; cette option permet de supprimer la première
- * et la dernière ligne si elles sont videx</li>
- * <li>wtriteString: String, default: output.write</li>
- */
-public class GeneratorTemplatesFilter extends DefaultFilter {
-
- protected boolean passEmptyLine = false;
- protected String writeString = "output.write";
-
- protected GeneratorTemplatesFilterIn inFilter = new GeneratorTemplatesFilterIn(this);
-
- public String getWriteString(){
- return writeString;
- }
-
- /**
- * methode appele lorsqu'on a la chaine entiere entre le header
- * et le footer.
- * @param ch la chaine trouve
- * @return ce qu'il faut ecrire dans le fichier de sortie
- */
- protected String performInFilter(String ch){
- if(ch.matches("generator option: *passEmptyLine *= *(true|false)")){
- passEmptyLine =
- "true".equalsIgnoreCase(ch.substring(ch.length()-4));
- return EMPTY_STRING;
- }else if(ch.matches("generator option: *writeString *= *.*")){
- writeString =
- ch.replaceAll("generator option: *writeString *= *(.*)", "$1");
- return EMPTY_STRING;
- }else{
- if (passEmptyLine && ch.length() > 0){
- // suppression des premieres et dernieres lignes si elles sont vides
- String [] all = ch.split("\n");
- if (all.length > 0){
- // si la derniere ne match que des blancs
- if(all[all.length-1].matches("\\s*")){
- int len = ch.length()-all[all.length-1].length()-1;
- ch = ch.substring(0, Math.max(len,0));
- }
-
- // suppression de la 1er ligne si elle est vide
- if(all[0].matches("\\s*")){
- int len = all[0].length()+1;
- ch = ch.substring(Math.min(ch.length(),len));
- }
- }
- }
-
- String result = inFilter.parse(ch) + inFilter.flush();
- return getWriteString()+ "(\"" + 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) {
- return ch;
- }
-
-
- /** la chaine du header */
- protected String getHeader() {
- return "/*{";
- }
-
- /** la chaine du footer */
- protected String getFooter() {
- return "}*/";
- }
-
- public static void main(String[] args) {
- Filter filter = new GeneratorTemplatesFilter();
- String res = filter.parse(" public void generatePackageStatement(Writer output, ObjectModelClassifier clazz) throws IOException {\n/*{\n package <%=clazz.getPackageName()%>.persistence.jdo; \n}*/ }");
- System.out.println(res);
- res = filter.flush();
- System.out.println(res);
- }
-
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,95 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
- * GeneratorTemplatesFilterIn.java
- *
- * Created: 14 janv. 2004
- *
- * @author Benjamin Poussin <poussin(a)codelutin.com>
- * Copyright Code Lutin
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-
-package org.codelutin.processor.filters;
-
-/**
- * Le tag *) n'est substitué que s'il est a l'extérieur du tag <%=...%>ou
- * <%...%>
- */
-public class GeneratorTemplatesFilterIn extends DefaultFilter { // GeneratorTemplatesFilterIn
-
- 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 "%>";
- }
-
-} // GeneratorTemplatesFilterIn
-
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/I18nFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/I18nFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/I18nFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,142 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/*******************************************************************************
- * I18nFilter.java
- *
- * Created: Sun Sep 1 2002
- *
- * @author <poussin(a)codelutin.com> Copyright Code Lutin
- *
- * @version $Revision$
- *
- * Mise a jour: $Date$ par : $Author$
- */
-
-package org.codelutin.processor.filters;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-public class I18nFilter extends DefaultFilter { // I18nFilter
-
- private String header = "_\\(\\s*\"";
- private String footer = "\"\\s*(\\)|,|\\+|$)";
-
- private Pattern headerPattern = Pattern.compile(getHeader());
- private Pattern footerPattern = Pattern.compile(getFooter());
-
- protected void setFooter(String footer) {
- this.footer = footer;
- }
-
- protected void setHeader(String header) {
- this.header = header;
- }
-
- protected String getHeader() {
- return header;
- }
-
- protected String getFooter() {
- return footer;
- }
-
- private Matcher matcher = null;
- public int getMatchIndexFor(String input, String sequence) {
- int index = NOT_FOUND;
-
- setMatcher(null);
- if (sequence == getHeader()) {
- setMatcher(getHeaderPattern().matcher(input));
- } else if (sequence == getFooter()){
- setMatcher(getFooterPattern().matcher(input));
- }
- if (getMatcher() != null) {
- try {
- getMatcher().find();
- index = getMatcher().start();
- } catch (RuntimeException e) {}
- }
-
- return index;
- }
-
- public int getMatchLengthFor(String sequence) {
- int length = NOT_FOUND;
-
- try {
- length = getMatcher().end()-getMatcher().start();
- } catch (RuntimeException e) {}
-
- return length;
- }
-
- /**
- * methode appele lorsqu'on a la chaine entiere entre le header et le
- * footer.
- *
- * @param ch
- * la chaine trouve
- * @return ce qu'il faut ecrire dans le fichier de sortie
- */
- protected String performInFilter(String ch) {
- return ch.replaceAll("\"\\s*\\+\\s*\"","") + "=";
- }
-
- public String performHeaderFooterFilter(String ch) {
- return ch.substring(ch.indexOf('"')+1, ch.lastIndexOf('"'));
- }
-
- /**
- * 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) {
- return EMPTY_STRING;
- }
-
- /**
- * @return Returns the footerPattern.
- */
- protected Pattern getFooterPattern() {
- return footerPattern;
- }
- /**
- * @return Returns the headerPattern.
- */
- protected Pattern getHeaderPattern() {
- return headerPattern;
- }
- /**
- * @return Returns the matcher.
- */
- protected Matcher getMatcher() {
- return matcher;
- }
- /**
- * @param matcher The matcher to set.
- */
- protected void setMatcher(Matcher matcher) {
- this.matcher = matcher;
- }
-} // I18nFilter
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LicenseFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LicenseFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LicenseFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,73 +0,0 @@
-/**
- * *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. *##%
- */
-package org.codelutin.processor.filters;
-
-/**
- * Un filtre pour remplacer la license d'un fichier source java.
- * <p/>
- * fixme : il faut ne pas autoriser le process de fichier java qui ne sont pas valide selon le header - footer...
- *
- * @author chemit
- */
-public class LicenseFilter extends DefaultFilter {
-
- public static final String HEADER = "*" + "#" + "#" + "%";
- public static final String FOOTER = "#" + "#" + "%" + "*";
- /**
- * la licence a insere dans le header du fichier source. Ce header est formatte en commentaire (chaque ligne
- * commence par un ' * ', sauf pour la premiere et derniere ligne).
- */
- protected String licenseHeader;
-
- /** flag pour indiquer si la licence a ete trouvee entre le header et le footer */
- protected boolean touched;
-
- public LicenseFilter(String licenseHeader) {
- this.licenseHeader = " " + licenseHeader + " ";
- }
-
- protected String performInFilter(String ch) {
- if (touched) {
- // on autorise pas deux process de la licence dans un fichier java
- throw new IllegalStateException("has find more than once the license processor tags in a file");
- }
- touched = true;
- return HEADER + licenseHeader + FOOTER;
- }
-
- protected String performOutFilter(String ch) {
- return ch;
- }
-
- protected String getHeader() {
- return HEADER;
- }
-
- protected String getFooter() {
- return FOOTER;
- }
-
- public boolean wasTouched() {
- return touched;
- }
-
- public void reset() {
- touched = false;
- }
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LogsFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LogsFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LogsFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,48 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* LogsFilter.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor.filters;
-
-/*
-* This class deals with the
-*/
-public abstract class LogsFilter extends DefaultFilter {
-
- private String header = "/*"+"#";
- private String footer = "#"+"*/";
-
- protected String getHeader(){
- return header;
- }
- protected String getFooter(){
- return footer;
- }
-}
-
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/NoActionFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/NoActionFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/NoActionFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,50 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* NoActionFilter.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor.filters;
-
-/*
-* This class deals with the
-*/
-public class NoActionFilter implements Filter {
-
- public String parse (String input) {
- return input;
- }
-
- public boolean hasCachedData(){
- return false;
- }
-
- public String flush (){
- return EMPTY_STRING;
- }
-
-}
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/OptimisationFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/OptimisationFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/OptimisationFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,69 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* OptimisationFilter.java
-*
-* Created: Wed Sep 4 2002
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor.filters;
-
-public class OptimisationFilter extends DefaultFilter { // OptimisationFilter
-
- public OptimisationFilter() {
-
- }
-
- private String header = "/*%";
- private String footer = "%*/";
-
- protected String getHeader(){
- return header;
- }
- protected String getFooter(){
- return footer;
- }
-
- /**
- * methode appele lorsqu'on a la chaine entiere entre le header
- * et le footer.
- * @param ch la chaine trouve
- * @return ce qu'il faut ecrire dans le fichier de sortie
- */
- protected String performInFilter(String ch){
- return ch;
- }
-
- /**
- * 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){
- return EMPTY_STRING;
- }
-
-} // OptimisationFilter
Deleted: nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/RemoveLogsCodeFilter.java
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/RemoveLogsCodeFilter.java 2009-05-13 16:04:45 UTC (rev 203)
+++ nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/RemoveLogsCodeFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -1,59 +0,0 @@
-/* *##% Lutin file processor
- * Copyright (C) 2002 - 2008 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
-
-/* *
-* RemoveLogsCodeFilter.java
-*
-* Created: Wed Jan 14 2004
-*
-* @author <poussin(a)codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package org.codelutin.processor.filters;
-
-/*
-* This class deals with the
-*/
-public class RemoveLogsCodeFilter extends LogsFilter {
-
- /**
- * methode appele lorsqu'on a la chaine entiere entre le header
- * et le footer.
- * @param ch la chaine trouve
- * @return ce qu'il faut ecrire dans le fichier de sortie
- */
- protected String performInFilter(String ch){
- return EMPTY_STRING;
- }
-
- /**
- * 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){
- return ch;
- }
-
-}
-
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/GeneratorTemplatesProcessor.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/GeneratorTemplatesProcessor.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/GeneratorTemplatesProcessor.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/GeneratorTemplatesProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,59 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+ * GeneratorTemplatesProcessor.java
+ *
+ * Created: Wed Sep 4 2002
+ *
+ * @author <pineau(a)codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+
+package org.nuiton.processor;
+
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.nuiton.processor.filters.GeneratorTemplatesFilter;
+
+public class GeneratorTemplatesProcessor extends Processor {
+
+ public GeneratorTemplatesProcessor(){
+ setInputFilter(new GeneratorTemplatesFilter());
+ }
+
+ static public void process(String filein, String fileout)
+ throws IOException{
+ Processor processor = new GeneratorTemplatesProcessor();
+ processor.process(new FileReader(filein), new FileWriter(fileout));
+ }
+
+ public static void main(String [] args)throws IOException{
+ if(args.length < 2) {
+ System.out.println("Give source and destination file");
+ System.exit(1);
+ } else {
+ process(args[0], args[1]);
+ }
+ }
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/GeneratorTemplatesProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/I18nExtractor.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/I18nExtractor.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/I18nExtractor.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/I18nExtractor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,120 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+ * I18nExtractor.java
+ *
+ * Created: Aug 16, 2004
+ *
+ * @author Cédric Pineau <pineau(a)codelutin.com>
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * by : $Author$
+ */
+
+package org.nuiton.processor;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.nuiton.processor.filters.I18nFilter;
+
+/**
+ *
+ */
+public class I18nExtractor {
+
+ protected I18nFilter filter = new I18nFilter();
+
+ protected HashMap<String,List<String>> i18nStringsMap = new HashMap<String,List<String>>();
+
+ public void extract(File[] srcFiles, File outputFile) throws IOException {
+ PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8")));
+ for (int i = 0; i < srcFiles.length; i++) {
+ processFile(srcFiles[i]);
+ }
+ for (Iterator<?> iter = i18nStringsMap.keySet().iterator(); iter.hasNext();) {
+ String i18nString = (String) iter.next();
+ List<?> locations = (List<?>) i18nStringsMap.get(i18nString);
+ for (Iterator<?> iterator = locations.iterator(); iterator.hasNext();) {
+ String location = (String) iterator.next();
+ writer.println("# "+location);
+ }
+ writer.println(i18nString+"=");
+ }
+ writer.close();
+ }
+
+ protected void processFile(File srcFile) throws IOException {
+ LineNumberReader lnr = new LineNumberReader(new InputStreamReader(new FileInputStream(srcFile), "UTF-8"));
+ while (lnr.ready()) {
+ String line = lnr.readLine();
+ int lineNumber = lnr.getLineNumber();
+ processLine(line, srcFile, lineNumber);
+ }
+ }
+
+ protected void processLine(String line, File srcFile, int lineNumber) {
+ String i18nStringsSet = filter.parse(line);
+ if (I18nFilter.EMPTY_STRING.equals(i18nStringsSet)) {
+ // Found a set of i18n Strings, split it.
+ String[] i18nStrings = i18nStringsSet.split("=");
+ for (int i = 0; i < i18nStrings.length; i++) {
+ String i18nString = i18nStrings[i];
+
+ List<String> locations = i18nStringsMap.get(i18nString);
+ if (locations == null) {
+ locations = new ArrayList<String>();
+ i18nStringsMap.put(i18nString, locations);
+ }
+ locations.add(srcFile.getPath()+"("+lineNumber+")");
+ }
+ }
+ }
+
+ public static void main(String[] args) {
+ if(args.length < 2) {
+ System.out.println("Please give at least sources and destination file");
+ System.exit(0);
+ } else if (args.length > 2) {
+ File[] sources = new File[args.length-1];
+ for (int i = 0; i < args.length-1; i++) {
+ sources[i] =new File(args[i]);
+ }
+ File destination = new File(args[args.length-1]);
+ try {
+ new I18nExtractor().extract(sources, destination);
+ } catch (IOException eee) {
+ java.util.logging.Logger.getLogger("org.codelutin.processor.I18nExtractor.").severe("Error during i18n extraction : "+eee);
+ System.out.println("!!! "+eee); // TODO remove this
+ }
+ }
+
+ }
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/I18nExtractor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LicenseProcessor.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LicenseProcessor.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LicenseProcessor.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LicenseProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,46 @@
+/**
+ * *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. *##%
+ */
+package org.nuiton.processor;
+
+import org.nuiton.processor.filters.LicenseFilter;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/** @author chemit */
+public class LicenseProcessor extends org.nuiton.processor.Processor {
+
+ protected LicenseFilter licenseFilter;
+
+ public LicenseProcessor(String header) {
+ licenseFilter = new LicenseFilter(header);
+ setInputFilter(licenseFilter);
+ }
+
+ public LicenseFilter getLicenceFilter() {
+ return licenseFilter;
+ }
+
+ public void process(File filein, File fileout) throws IOException {
+ process(new FileReader(filein), new FileWriter(fileout));
+ }
+}
+
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LicenseProcessor.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LogsProcessor.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/LogsProcessor.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LogsProcessor.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LogsProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,87 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* LogsProcessor.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor;
+
+import org.nuiton.processor.filters.*;
+import java.io.*;
+
+/*
+* This class is a processor for source logs
+*/
+public class LogsProcessor extends Processor {
+
+ /** Type of actions */
+ protected static class Action {}
+ /** Do nothing */
+ public final static Action NoAction = new Action();
+
+ /** Active logs in output. This is the default action */
+ public final static Action Logs = new Action();
+ /** Remove logs in output */
+ public final static Action NoLogsCode = new Action();
+
+ public LogsProcessor (Action action) {
+ if (action == NoAction) {
+ // No action is the default filter in Processor
+ } else if (action == NoLogsCode) {
+ setInputFilter(new RemoveLogsCodeFilter());
+ } else {
+ // Go for logs
+ setInputFilter(new ActiveLogsCodeFilter());
+ }
+ }
+
+ public static void main(String [] args) throws Exception {
+ LogsProcessor processor;
+ if(args.length < 2) {
+ System.out.println("Give source and destination file, then action");
+ System.out.println("Action may be remove or active (default is no action)");
+ System.exit(0);
+ } else if (args.length > 2) {
+ if (args[2].equals("remove")) {
+ processor = new LogsProcessor(NoLogsCode);
+ System.out.println("Removing logs code");
+ } else if (args[2].equals("active")) {
+ processor = new LogsProcessor(Logs);
+ System.out.println("Setting logs active");
+ } else {
+ processor = new LogsProcessor(NoAction);
+ System.out.println("No action taken");
+ }
+ try {
+ processor.process(new FileReader(args[0]),
+ new FileWriter(args[1]));
+ } catch (IOException eee) {
+ java.util.logging.Logger.getLogger("org.codelutin.processor.LogsProcessor.").severe("Error during log processing: "+eee);
+ }
+ }
+ }
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/LogsProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/OptimisationProcessor.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/OptimisationProcessor.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/OptimisationProcessor.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/OptimisationProcessor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,57 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* OptimisationProcessor.java
+*
+* Created: Wed Sep 4 2002
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor;
+
+import java.io.*;
+import org.nuiton.processor.filters.OptimisationFilter;
+
+public class OptimisationProcessor extends Processor { // OptimisationProcessor
+
+ public OptimisationProcessor(){
+ setInputFilter(new OptimisationFilter());
+ }
+
+ static public void process(String filein, String fileout)
+ throws IOException{
+ Processor processor = new OptimisationProcessor();
+ processor.process(new FileReader(filein), new FileWriter(fileout));
+ }
+
+ public static void main(String [] args)throws IOException{
+ if(args.length < 2) {
+ System.out.println("Give source and destination file");
+ System.exit(1);
+ } else {
+ process(args[0], args[1]);
+ }
+ }
+
+} // OptimisationProcessor
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/OptimisationProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/Processor.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/Processor.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/Processor.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/Processor.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,97 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+ * Processor.java
+ *
+ * Created: Wed Jan 14 2004
+ *
+ * @author <poussin(a)codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+package org.nuiton.processor;
+
+import org.nuiton.processor.filters.*;
+import org.nuiton.processor.filters.Filter;
+import java.io.*;
+import java.util.logging.Logger;
+
+/*
+ * This class is a generic sources processor
+ * Given a reader class name and a writer class name
+ */
+public class Processor {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Logger log = Logger.getLogger("org.codelutin.processor.Processor");
+ protected Filter[] inputFilter = new Filter[]{new NoActionFilter()};
+ protected Filter outputFilter = new NoActionFilter();
+
+ public Processor() {
+ }
+
+ public Processor(Filter[] filters) {
+ setInputFilter(filters);
+ }
+
+ public void setInputFilter(Filter inFilter) {
+ setInputFilter(new Filter[]{inFilter});
+ }
+
+ public void setInputFilter(Filter[] inFilter) {
+ inputFilter = inFilter;
+ }
+
+ public void setOutputFilter(Filter outFilter) {
+ outputFilter = outFilter;
+ }
+
+ protected BufferedReader getReader(Reader externalInput) {
+ BufferedReader result = new BufferedReader(externalInput);
+ for (int i = 0; i < inputFilter.length; i++) {
+ result = new ProcessorReader(result, inputFilter[i]);
+ }
+ return result;
+ }
+
+ /** Process all available data
+ * @param externalInput
+ * @param externalOutput
+ * @throws IOException if any pb
+ */
+ public void process(Reader externalInput, Writer externalOutput) throws IOException {
+ log.finest("Debug du process");
+ BufferedReader input = getReader(externalInput);
+ ProcessorWriter output =
+ new ProcessorWriter(new BufferedWriter(externalOutput), outputFilter);
+
+ log.finest("input: " + input);
+ log.finest("output: " + output);
+
+ String line = input.readLine();
+ while (line != null) {
+ log.finest("Ligne lu: " + line);
+ output.writeLine(line);
+ line = input.readLine();
+ }
+ output.flush();
+ }
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/Processor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorReader.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorReader.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorReader.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorReader.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,101 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* ProcessorReader.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.nuiton.processor.filters.Filter;
+
+public class ProcessorReader extends BufferedReader {
+
+ protected BufferedReader input;
+ protected Filter filter;
+ protected String lineSeparator;
+
+ protected ProcessorReader(){
+ super(new StringReader(""));
+ }
+
+ public ProcessorReader(BufferedReader input, Filter filter) {
+ this();
+ setInput(input);
+ this.filter = filter;
+ lineSeparator = System.getProperty("line.separator");
+ }
+
+ public void setInput(BufferedReader input){
+ this.input = input;
+ }
+
+ @Override
+ public boolean markSupported(){
+ return false;
+ }
+
+ @Override
+ public String readLine() throws IOException {
+ if (input.ready()) {
+ String line = input.readLine();
+ if(line != null){
+ if (!(input instanceof ProcessorReader)){
+ line += lineSeparator;
+ }
+ return filter.parse(line);
+ }
+ }
+ if(filter.hasCachedData()){
+ return filter.flush();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean ready() {
+ try {
+ boolean ready = input.ready();
+ if (ready) {
+ return true;
+ }
+ return filter.hasCachedData();
+ } catch (IOException eee) {
+ return false;
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ input.close();
+ }
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorReader.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorWriter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ProcessorWriter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorWriter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorWriter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,64 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/**
+* ProcessorWriter.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor;
+
+import org.nuiton.processor.filters.*;
+import java.io.*;
+
+public class ProcessorWriter {
+
+ protected BufferedWriter output;
+ protected Filter filter;
+
+ public ProcessorWriter(BufferedWriter output, Filter filter) {
+ this.output = output;
+ this.filter = filter;
+ }
+
+ public void writeLine(String line) throws IOException {
+
+ // TODO Euh on se sert quand du filtre de sortie ???? :-)
+ output.write(line);
+ }
+
+ public void newLine() throws IOException {
+ output.newLine();
+ }
+
+ public void flush() throws IOException {
+ output.flush();
+ }
+
+ public void close() throws IOException {
+ output.close();
+ }
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ProcessorWriter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/I18nExtractorTask.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/I18nExtractorTask.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/I18nExtractorTask.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/I18nExtractorTask.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,154 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+package org.nuiton.processor.ant;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.nuiton.processor.I18nExtractor;
+
+/**
+ * I18nExtractorTask.
+ *
+ * Created: Aug 16, 2004
+ *
+ * @author Cédric Pineau <pineau(a)codelutin.com>
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * by : $Author$
+ */
+public class I18nExtractorTask extends MatchingTask {
+
+ public static final int MSG_VERBOSE = Project.MSG_VERBOSE;
+
+ protected File srcDir;
+
+ protected File destFile;
+
+ protected String[] includes = new String[] {};
+
+ protected String[] excludes = new String[] {};
+
+ protected String[] srcFileNames;
+
+ public I18nExtractorTask() {
+
+ }
+
+ protected void doExecute() throws BuildException {
+ // creation du repertoire pour le fichier destination
+ destFile.getParentFile().mkdirs();
+ List<File> fileList = new ArrayList<File>();
+ for (int i = 0; i < srcFileNames.length; i++) {
+ fileList.add(new File(srcFileNames[i]));
+ }
+ try {
+ new I18nExtractor()
+ .extract(fileList.toArray(new File[0]), destFile);
+ } catch (IOException eee) {
+ throw new BuildException(eee);
+ }
+ }
+
+ public void setSrcdir(File srcDir) {
+ this.srcDir = srcDir;
+ }
+
+ public void setDestFile(File destFile) {
+ this.destFile = destFile;
+ }
+
+ @Override
+ public void execute() throws BuildException {
+ // first of all, make sure that we've got a srcdir
+ if (srcDir == null) {
+ throw new BuildException("srcdir attribute must be set!",
+ getLocation());
+ }
+ if (!srcDir.exists()) {
+ throw new BuildException("srcdir \"" + srcDir.getPath()
+ + "\" does not exist!", getLocation());
+ }
+
+ if (destFile == null) {
+ throw new BuildException("destFile attribute must be set!",
+ getLocation());
+ }
+
+ // Build the list of files to compute
+ buildFileList();
+
+ // generate the source files
+ doExecute();
+ }
+
+ protected void buildFileList() {
+
+ // Obtain this list of files within the source directory
+ DirectoryScanner ds = getDirectoryScanner(srcDir);
+
+ String[] includes = getIncludes();
+ if (includes.length > 0) {
+ ds.setIncludes(includes);
+ }
+ String[] excludes = getExcludes();
+ if (excludes.length > 0) {
+ ds.setExcludes(excludes);
+ }
+
+ ds.scan();
+
+ // on met le resultat dans files
+ srcFileNames = ds.getIncludedFiles();
+ }
+
+ protected boolean isNewer(String filein, String fileout) {
+ boolean result = new File(filein).lastModified() > new File(fileout)
+ .lastModified();
+ if (result) {
+ log(filein + " is newer than " + fileout, MSG_VERBOSE);
+ }
+ return result;
+ }
+
+ protected String[] getExcludes() {
+ return excludes;
+ }
+
+ protected String[] getIncludes() {
+ return includes;
+ }
+
+ @Override
+ public void setIncludes(String includes) {
+ this.includes = includes.split(",");
+ }
+
+ @Override
+ public void setExcludes(String excludes) {
+ this.excludes = excludes.split(",");
+ }
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/I18nExtractorTask.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/ProcessorTask.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/ant/ProcessorTask.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/ProcessorTask.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/ProcessorTask.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,246 @@
+/*
+ * *##% Lutin file processor
+ * Copyright (C) 2002 - 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*
+ */
+
+package org.nuiton.processor.ant;
+
+import java.io.File;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.nuiton.processor.Processor;
+import org.nuiton.processor.filters.Filter;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+
+/**
+ * Tache ant pour lutinprocessor.
+ *
+ * To use this task, put this code in ant build file:
+ *
+ * <taskdef name="processor" classname="org.codelutin.processor.ant.ProcessorTask"
+ * classpath="lib/lutinprocessor.jar" />
+ *
+ * and use it with:
+ *
+ * <processor srcdir="${src}" destdir="${targetgen}" filters="org.codelutin.processor.filters.GeneratorTemplatesFilter" />
+ *
+ * Created: 14 janv. 2004
+ *
+ * @author Benjamin Poussin <poussin(a)codelutin.com> Copyright Code Lutin
+ *
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$ par : $Author$
+ */
+public class ProcessorTask extends MatchingTask { // ProcessorTask
+
+ public static final int MSG_VERBOSE = Project.MSG_VERBOSE;
+
+ protected File srcDir;
+
+ protected File destDir;
+
+ protected String[] includes = new String[] {};
+
+ protected String[] excludes = new String[] {};
+
+ protected String[] files;
+
+ protected String fileInPattern = "";
+
+ protected String fileOutPattern = "";
+
+ protected String filters = "org.codelutin.processor.filters.NoActionFilter";
+
+ protected boolean overwrite = true;
+
+ protected boolean verbose = false;
+
+ public ProcessorTask() {
+
+ }
+
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ public void setOverwrite(boolean overwrite) {
+ this.overwrite = overwrite;
+ }
+
+ public void setFileOutPattern(String fileOutPattern) {
+ this.fileOutPattern = fileOutPattern;
+ }
+
+ public void setFileInPattern(String fileInPattern) {
+ this.fileInPattern = fileInPattern;
+ }
+
+ public void setSrcdir(File srcDir) {
+ this.srcDir = srcDir;
+ }
+
+ public void setDestdir(File destDir) {
+ this.destDir = destDir;
+ }
+
+ public void setFilters(String filters) {
+ this.filters = filters;
+ }
+
+ protected String applyTransformationFilename(String filename) {
+ return filename.replaceAll(fileInPattern, fileOutPattern);
+ }
+
+ protected void doExecute() throws BuildException {
+ Processor processor = new Processor(getFilters());
+ int numberFiles;
+ for (numberFiles = 0; numberFiles < files.length; numberFiles++) {
+ String inputFileName = absoluteSourceName(files[numberFiles]);
+ String outputFileName = absoluteDestinationName(applyTransformationFilename(files[numberFiles]));
+ if (verbose) {
+ log("Using " + inputFileName);
+ }
+ if (overwrite || isNewer(inputFileName, outputFileName)) {
+ if (verbose) {
+ log("Generating " + outputFileName);
+ }
+ // creation du repertoire pour le fichier destination
+ new File(outputFileName).getParentFile().mkdirs();
+ try {
+ processor.process(new FileReader(inputFileName),
+ new FileWriter(outputFileName));
+ } catch (IOException eee) {
+ throw new BuildException(eee);
+ }
+ }
+ }
+ log("Generating " + numberFiles + " files to " + destDir);
+ }
+
+ protected Filter[] getFilters() throws BuildException {
+ String[] filterList = filters.split(",");
+ Filter[] result = new Filter[filterList.length];
+ for (int i = 0; i < filterList.length; i++) {
+ try {
+ // Class.forName semble fonctionner maintenant
+ // avant il fallait utiliser getClass().forName
+ result[i] = (Filter) Class.forName(filterList[i].trim())
+ .newInstance();
+ } catch (Exception eee) {
+ throw new BuildException("Error during looking for '"
+ + filterList[i].trim() + "' class", eee);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public void execute() throws BuildException {
+ // first of all, make sure that we've got a srcdir
+ if (srcDir == null) {
+ throw new BuildException("srcdir attribute must be set!",
+ getLocation());
+ }
+ if (!srcDir.exists()) {
+ throw new BuildException("srcdir \"" + srcDir.getPath()
+ + "\" does not exist!", getLocation());
+ }
+
+ if (destDir == null) {
+ destDir = srcDir;
+ }
+ if (!destDir.isDirectory()) {
+ throw new BuildException("destination directory \"" + destDir
+ + "\" does not exist or is not a directory", getLocation());
+ }
+
+ // Build the list of files to compute
+ buildFileList();
+
+ // generate the source files
+ doExecute();
+ }
+
+ protected void buildFileList() {
+
+ // Obtain this list of files within the source directory
+ DirectoryScanner ds = getDirectoryScanner(srcDir);
+
+ String[] includes = getIncludes();
+ if (includes.length > 0) {
+ ds.setIncludes(includes);
+ }
+ String[] excludes = getExcludes();
+ if (excludes.length > 0) {
+ ds.setExcludes(excludes);
+ }
+
+ ds.scan();
+
+ // on recherche ceux que l'on doit vraiment refaire
+ files = ds.getIncludedFiles();
+ }
+
+ protected boolean isNewer(String filein, String fileout) {
+ boolean result = new File(filein).lastModified() > new File(fileout)
+ .lastModified();
+ if (result) {
+ log(filein + " is newer than " + fileout, MSG_VERBOSE);
+ }
+ return result;
+ }
+
+ protected String[] getExcludes() {
+ return excludes;
+ }
+
+ protected String[] getIncludes() {
+ return includes;
+ }
+
+ public void setIncludes(String[] includes) {
+ this.includes = includes;
+ }
+
+ @Override
+ public void setIncludes(String includes) {
+ setIncludes(includes.split(","));
+ }
+
+ public void setExcludes(String[] excludes) {
+ this.excludes = excludes;
+ }
+
+ @Override
+ public void setExcludes(String excludes) {
+ setExcludes(excludes.split(","));
+ }
+
+ protected String absoluteDestinationName(String fileName) {
+ return destDir.getPath() + File.separator + fileName;
+ }
+
+ protected String absoluteSourceName(String fileName) {
+ return srcDir.getPath() + File.separator + fileName;
+ }
+
+} // ProcessorTask
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/ant/ProcessorTask.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/ActiveLogsCodeFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/ActiveLogsCodeFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/ActiveLogsCodeFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/ActiveLogsCodeFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,64 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* x*
+* ActiveLogsCodeFilter.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor.filters;
+
+/*
+* This class deals with the
+*/
+public class ActiveLogsCodeFilter extends LogsFilter {
+
+ /**
+ * methode appele lorsqu'on a la chaine entiere entre le header
+ * et le footer.
+ * @param ch la chaine trouve
+ * @return ce qu'il faut ecrire dans le fichier de sortie
+ */
+ @Override
+ protected String performInFilter(String ch){
+ // Logs must be performed within a try{...}catch{} bloc
+ return
+ "try {" +
+ ch +
+ "} catch (Exception logsE) { System.err.println(\"Error in Logging instructions\"); logsE.printStackTrace(); }";
+ }
+
+ /**
+ * 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
+ */
+ @Override
+ protected String performOutFilter(String ch){
+ return ch;
+ }
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/ActiveLogsCodeFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/DefaultFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/DefaultFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/DefaultFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/DefaultFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,140 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+/*******************************************************************************
+ * DefaultFilter.java
+ *
+ * Created: Wed Sep 4 2002
+ *
+ * @author <poussin(a)codelutin.com>Copyright Code Lutin
+ *
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$ par : $Author$
+ */
+package org.nuiton.processor.filters;
+
+public abstract class DefaultFilter implements Filter { // DefaultFilter
+
+ public static int NOT_FOUND = -1;
+ protected StringBuffer cachedContent = new StringBuffer();
+
+ public DefaultFilter() {
+ }
+
+ /** Type of states */
+ protected static class State {
+
+ /** Looking-for-header state */
+ public final static State SEARCH_HEADER = new State();
+ /** Looking-for-footer state */
+ public final static State SEARCH_FOOTER = new State();
+ }
+ protected State currentState = State.SEARCH_HEADER;
+
+ @Override
+ public String parse(String input) {
+ int matchingIndex;
+
+ // add new input to current content
+ cachedContent.append(input);
+ String content = cachedContent.toString();
+
+ if (currentState.equals(State.SEARCH_HEADER)) {
+ // Looking for a header
+ matchingIndex = getMatchIndexFor(content, getHeader());
+ if (matchingIndex != NOT_FOUND) {
+ // Header found, return "out" part of it + recursive process of remaining chars
+ currentState = State.SEARCH_FOOTER;
+ cachedContent.setLength(0);
+ return performOutFilter(content.substring(0, matchingIndex)) + parse(content.substring(matchingIndex));
+ }
+ // No header found !
+ return EMPTY_STRING;
+ }
+
+ if (currentState.equals(State.SEARCH_FOOTER)) {
+ // Looking for a footer
+ matchingIndex = getMatchIndexFor(content, getFooter());
+ if (matchingIndex != NOT_FOUND) {
+ // Footer found, return "in" part of it + recursive process of remaining chars
+ currentState = State.SEARCH_HEADER;
+ cachedContent.setLength(0);
+ int matchingEndIndex = matchingIndex + getMatchLengthFor(getFooter());
+ return performInFilter(performHeaderFooterFilter(content.substring(0, matchingEndIndex))) + parse(content.substring(matchingEndIndex));
+ }
+ // No footer found !
+ return EMPTY_STRING;
+ }
+
+ return "INVALID STATE in DefaultFilter !";
+ }
+
+ public String performHeaderFooterFilter(String ch) {
+ return ch.substring(getHeader().length(), ch.length() - getFooter().length());
+ }
+
+ public int getMatchIndexFor(String input, String sequence) {
+ return input.indexOf(sequence);
+ }
+
+ public int getMatchLengthFor(String sequence) {
+ return sequence.length();
+ }
+
+ @Override
+ public boolean hasCachedData() {
+ return (cachedContent.length() > 0);
+ }
+
+ @Override
+ public String flush() {
+ String line = cachedContent.toString();
+ // Empty the cache,
+ cachedContent.setLength(0);
+ // and returns its content
+ if (currentState.equals(State.SEARCH_HEADER)) {
+ return performOutFilter(line);
+ }
+ return performInFilter(line);
+ }
+
+ /**
+ * methode appele lorsqu'on a la chaine entiere entre le header et le
+ * footer.
+ *
+ * @param ch
+ * la chaine trouve
+ * @return ce qu'il faut ecrire dans le fichier de sortie
+ */
+ abstract protected String performInFilter(String ch);
+
+ /**
+ * 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
+ */
+ abstract protected String performOutFilter(String ch);
+
+ /** @return la chaine du header */
+ abstract protected String getHeader();
+
+ /** @return la chaine du footer */
+ abstract protected String getFooter();
+} // DefaultFilter
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/DefaultFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/Filter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/Filter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/Filter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/Filter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,41 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* Filter.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor.filters;
+
+public interface Filter {
+
+ final static String EMPTY_STRING = "";
+
+ String parse (String input);
+ boolean hasCachedData();
+ String flush ();
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/Filter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,139 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+ * GeneratorTemplatesFilter.java
+ *
+ * Created: Wed Sep 4 2002
+ *
+ * @author <pineau(a)codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+
+/**
+ * MultilinesLitteralsFilter.java
+ */
+
+package org.nuiton.processor.filters;
+
+/*
+ * Classe principale du filtre de génération. Ce filtre recherche tout ce qu'il
+ * y a entre les tag /*{ et }*/ a l'interieur de ces tags un autre filtre
+ * ({@link org.codelutin.processor.filters.GeneratorTemplatesFilterIn}) est
+ * utilisé pour générer les tags <% %>, <%= %> et *).
+ * <ul>
+ * <li>/*{ et }*/ est remplacer par output.write("..."); pour chaque
+ * ligne et les " sont coté</li>
+ * <li><% %></li>
+ * <li><%= %></li>
+ * <li>*) permet de fermer un commentaire sans le fermer réeellement, cela
+ * permet au éditeur faisant une analyse du code de continuer a fonctionner
+ * ce tag est remplacé par son equivalent */ après génération.</li>
+ * </ul>
+ * Vous pouvez modifier le comportement du processor en mettant des options
+ * Une option est incluse dans le tag et est de la forme
+ * /*{generator option: <optionName> = valeur}*/
+ * les options existantes sont:
+ * <li>passEmptyLine: boolean; cette option permet de supprimer la première
+ * et la dernière ligne si elles sont videx</li>
+ * <li>wtriteString: String, default: output.write</li>
+ */
+public class GeneratorTemplatesFilter extends DefaultFilter {
+
+ protected boolean passEmptyLine = false;
+ protected String writeString = "output.write";
+
+ protected GeneratorTemplatesFilterIn inFilter = new GeneratorTemplatesFilterIn(this);
+
+ public String getWriteString(){
+ return writeString;
+ }
+
+ /**
+ * methode appele lorsqu'on a la chaine entiere entre le header
+ * et le footer.
+ * @param ch la chaine trouve
+ * @return ce qu'il faut ecrire dans le fichier de sortie
+ */
+ protected String performInFilter(String ch){
+ if(ch.matches("generator option: *passEmptyLine *= *(true|false)")){
+ passEmptyLine =
+ "true".equalsIgnoreCase(ch.substring(ch.length()-4));
+ return EMPTY_STRING;
+ }else if(ch.matches("generator option: *writeString *= *.*")){
+ writeString =
+ ch.replaceAll("generator option: *writeString *= *(.*)", "$1");
+ return EMPTY_STRING;
+ }else{
+ if (passEmptyLine && ch.length() > 0){
+ // suppression des premieres et dernieres lignes si elles sont vides
+ String [] all = ch.split("\n");
+ if (all.length > 0){
+ // si la derniere ne match que des blancs
+ if(all[all.length-1].matches("\\s*")){
+ int len = ch.length()-all[all.length-1].length()-1;
+ ch = ch.substring(0, Math.max(len,0));
+ }
+
+ // suppression de la 1er ligne si elle est vide
+ if(all[0].matches("\\s*")){
+ int len = all[0].length()+1;
+ ch = ch.substring(Math.min(ch.length(),len));
+ }
+ }
+ }
+
+ String result = inFilter.parse(ch) + inFilter.flush();
+ return getWriteString()+ "(\"" + 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) {
+ return ch;
+ }
+
+
+ /** la chaine du header */
+ protected String getHeader() {
+ return "/*{";
+ }
+
+ /** la chaine du footer */
+ protected String getFooter() {
+ return "}*/";
+ }
+
+ public static void main(String[] args) {
+ Filter filter = new GeneratorTemplatesFilter();
+ String res = filter.parse(" public void generatePackageStatement(Writer output, ObjectModelClassifier clazz) throws IOException {\n/*{\n package <%=clazz.getPackageName()%>.persistence.jdo; \n}*/ }");
+ System.out.println(res);
+ res = filter.flush();
+ System.out.println(res);
+ }
+
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/GeneratorTemplatesFilterIn.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,100 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+ * GeneratorTemplatesFilterIn.java
+ *
+ * Created: 14 janv. 2004
+ *
+ * @author Benjamin Poussin <poussin(a)codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+
+package org.nuiton.processor.filters;
+
+/**
+ * Le tag *) n'est substitué que s'il est a l'extérieur du tag <%=...%>ou
+ * <%...%>
+ */
+public class GeneratorTemplatesFilterIn extends DefaultFilter { // GeneratorTemplatesFilterIn
+
+ 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
+ */
+ @Override
+ 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
+ * @param ch la chaine a convertir
+ * @return la chaine convertie
+ */
+ 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
+ */
+ @Override
+ 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;
+ }
+
+ @Override
+ protected String getHeader() {
+ return "<%";
+ }
+
+ @Override
+ protected String getFooter() {
+ return "%>";
+ }
+
+} // GeneratorTemplatesFilterIn
+
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/GeneratorTemplatesFilterIn.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/I18nFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/I18nFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/I18nFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/I18nFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,142 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/*******************************************************************************
+ * I18nFilter.java
+ *
+ * Created: Sun Sep 1 2002
+ *
+ * @author <poussin(a)codelutin.com> Copyright Code Lutin
+ *
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$ par : $Author$
+ */
+
+package org.nuiton.processor.filters;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+public class I18nFilter extends DefaultFilter { // I18nFilter
+
+ private String header = "_\\(\\s*\"";
+ private String footer = "\"\\s*(\\)|,|\\+|$)";
+
+ private Pattern headerPattern = Pattern.compile(getHeader());
+ private Pattern footerPattern = Pattern.compile(getFooter());
+
+ protected void setFooter(String footer) {
+ this.footer = footer;
+ }
+
+ protected void setHeader(String header) {
+ this.header = header;
+ }
+
+ protected String getHeader() {
+ return header;
+ }
+
+ protected String getFooter() {
+ return footer;
+ }
+
+ private Matcher matcher = null;
+ public int getMatchIndexFor(String input, String sequence) {
+ int index = NOT_FOUND;
+
+ setMatcher(null);
+ if (sequence == getHeader()) {
+ setMatcher(getHeaderPattern().matcher(input));
+ } else if (sequence == getFooter()){
+ setMatcher(getFooterPattern().matcher(input));
+ }
+ if (getMatcher() != null) {
+ try {
+ getMatcher().find();
+ index = getMatcher().start();
+ } catch (RuntimeException e) {}
+ }
+
+ return index;
+ }
+
+ public int getMatchLengthFor(String sequence) {
+ int length = NOT_FOUND;
+
+ try {
+ length = getMatcher().end()-getMatcher().start();
+ } catch (RuntimeException e) {}
+
+ return length;
+ }
+
+ /**
+ * methode appele lorsqu'on a la chaine entiere entre le header et le
+ * footer.
+ *
+ * @param ch
+ * la chaine trouve
+ * @return ce qu'il faut ecrire dans le fichier de sortie
+ */
+ protected String performInFilter(String ch) {
+ return ch.replaceAll("\"\\s*\\+\\s*\"","") + "=";
+ }
+
+ public String performHeaderFooterFilter(String ch) {
+ return ch.substring(ch.indexOf('"')+1, ch.lastIndexOf('"'));
+ }
+
+ /**
+ * 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) {
+ return EMPTY_STRING;
+ }
+
+ /**
+ * @return Returns the footerPattern.
+ */
+ protected Pattern getFooterPattern() {
+ return footerPattern;
+ }
+ /**
+ * @return Returns the headerPattern.
+ */
+ protected Pattern getHeaderPattern() {
+ return headerPattern;
+ }
+ /**
+ * @return Returns the matcher.
+ */
+ protected Matcher getMatcher() {
+ return matcher;
+ }
+ /**
+ * @param matcher The matcher to set.
+ */
+ protected void setMatcher(Matcher matcher) {
+ this.matcher = matcher;
+ }
+} // I18nFilter
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/I18nFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LicenseFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LicenseFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LicenseFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LicenseFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,73 @@
+/**
+ * *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. *##%
+ */
+package org.nuiton.processor.filters;
+
+/**
+ * Un filtre pour remplacer la license d'un fichier source java.
+ * <p/>
+ * fixme : il faut ne pas autoriser le process de fichier java qui ne sont pas valide selon le header - footer...
+ *
+ * @author chemit
+ */
+public class LicenseFilter extends DefaultFilter {
+
+ public static final String HEADER = "*" + "#" + "#" + "%";
+ public static final String FOOTER = "#" + "#" + "%" + "*";
+ /**
+ * la licence a insere dans le header du fichier source. Ce header est formatte en commentaire (chaque ligne
+ * commence par un ' * ', sauf pour la premiere et derniere ligne).
+ */
+ protected String licenseHeader;
+
+ /** flag pour indiquer si la licence a ete trouvee entre le header et le footer */
+ protected boolean touched;
+
+ public LicenseFilter(String licenseHeader) {
+ this.licenseHeader = " " + licenseHeader + " ";
+ }
+
+ protected String performInFilter(String ch) {
+ if (touched) {
+ // on autorise pas deux process de la licence dans un fichier java
+ throw new IllegalStateException("has find more than once the license processor tags in a file");
+ }
+ touched = true;
+ return HEADER + licenseHeader + FOOTER;
+ }
+
+ protected String performOutFilter(String ch) {
+ return ch;
+ }
+
+ protected String getHeader() {
+ return HEADER;
+ }
+
+ protected String getFooter() {
+ return FOOTER;
+ }
+
+ public boolean wasTouched() {
+ return touched;
+ }
+
+ public void reset() {
+ touched = false;
+ }
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LicenseFilter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LogsFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/LogsFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LogsFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LogsFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,48 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* LogsFilter.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor.filters;
+
+/*
+* This class deals with the
+*/
+public abstract class LogsFilter extends DefaultFilter {
+
+ private String header = "/*"+"#";
+ private String footer = "#"+"*/";
+
+ protected String getHeader(){
+ return header;
+ }
+ protected String getFooter(){
+ return footer;
+ }
+}
+
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/LogsFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/NoActionFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/NoActionFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/NoActionFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/NoActionFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,50 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* NoActionFilter.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor.filters;
+
+/*
+* This class deals with the
+*/
+public class NoActionFilter implements Filter {
+
+ public String parse (String input) {
+ return input;
+ }
+
+ public boolean hasCachedData(){
+ return false;
+ }
+
+ public String flush (){
+ return EMPTY_STRING;
+ }
+
+}
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/NoActionFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/OptimisationFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/OptimisationFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/OptimisationFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/OptimisationFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,69 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* OptimisationFilter.java
+*
+* Created: Wed Sep 4 2002
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor.filters;
+
+public class OptimisationFilter extends DefaultFilter { // OptimisationFilter
+
+ public OptimisationFilter() {
+
+ }
+
+ private String header = "/*%";
+ private String footer = "%*/";
+
+ protected String getHeader(){
+ return header;
+ }
+ protected String getFooter(){
+ return footer;
+ }
+
+ /**
+ * methode appele lorsqu'on a la chaine entiere entre le header
+ * et le footer.
+ * @param ch la chaine trouve
+ * @return ce qu'il faut ecrire dans le fichier de sortie
+ */
+ protected String performInFilter(String ch){
+ return ch;
+ }
+
+ /**
+ * 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){
+ return EMPTY_STRING;
+ }
+
+} // OptimisationFilter
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/OptimisationFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Copied: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/RemoveLogsCodeFilter.java (from rev 202, nuitonprocessor/trunk/src/main/java/org/codelutin/processor/filters/RemoveLogsCodeFilter.java)
===================================================================
--- nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/RemoveLogsCodeFilter.java (rev 0)
+++ nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/RemoveLogsCodeFilter.java 2009-05-13 16:41:38 UTC (rev 204)
@@ -0,0 +1,59 @@
+/* *##% Lutin file processor
+ * Copyright (C) 2002 - 2008 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */
+
+/* *
+* RemoveLogsCodeFilter.java
+*
+* Created: Wed Jan 14 2004
+*
+* @author <poussin(a)codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package org.nuiton.processor.filters;
+
+/*
+* This class deals with the
+*/
+public class RemoveLogsCodeFilter extends LogsFilter {
+
+ /**
+ * methode appele lorsqu'on a la chaine entiere entre le header
+ * et le footer.
+ * @param ch la chaine trouve
+ * @return ce qu'il faut ecrire dans le fichier de sortie
+ */
+ protected String performInFilter(String ch){
+ return EMPTY_STRING;
+ }
+
+ /**
+ * 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){
+ return ch;
+ }
+
+}
+
Property changes on: nuitonprocessor/trunk/src/main/java/org/nuiton/processor/filters/RemoveLogsCodeFilter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
1
0
[Lutinprocessor-commits] r203 - in nuitonprocessor/trunk: . src/main src/main/java/org src/site
by tchemit@users.labs.libre-entreprise.org 13 May '09
by tchemit@users.labs.libre-entreprise.org 13 May '09
13 May '09
Author: tchemit
Date: 2009-05-13 16:04:45 +0000 (Wed, 13 May 2009)
New Revision: 203
Added:
nuitonprocessor/trunk/src/main/java/org/nuiton/
nuitonprocessor/trunk/src/main/resources/
Modified:
nuitonprocessor/trunk/pom.xml
nuitonprocessor/trunk/src/site/site.xml
Log:
migrate to nuiton
Modified: nuitonprocessor/trunk/pom.xml
===================================================================
--- nuitonprocessor/trunk/pom.xml 2009-05-11 02:59:13 UTC (rev 202)
+++ nuitonprocessor/trunk/pom.xml 2009-05-13 16:04:45 UTC (rev 203)
@@ -11,11 +11,18 @@
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
<version>3.5.4</version>
+ <!--groupId>org.nuiton</groupId>
+ <artifactId>mavenpom</artifactId>
+ <version>1.0.0-SNAPSHOT</version-->
</parent>
- <artifactId>lutinprocessor</artifactId>
- <version>0.19-SNAPSHOT</version>
+ <!-- assuprimer du de l'utilisation de mavenpom -->
+ <groupId>org.nuiton</groupId>
+ <url>${site.home.url}</url>
+ <artifactId>nuitonprocessor</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
@@ -29,7 +36,7 @@
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
- <name>Lutin file processor</name>
+ <name>Universal file processor</name>
<description>
Cette librairie permet la création de filtre sur les fichiers sources.
</description>
@@ -43,15 +50,15 @@
<properties>
- <!-- id du projet du labs -->
+ <nuiton.project>nuitonprocessor</nuiton.project>
+
+ <!-- assuprimer du de l'utilisation de mavenpom -->
<labs.id>28</labs.id>
-
- <!-- nom du projet sur le labs (pas necessaire car = artifactId) -->
<labs.project>lutinprocessor</labs.project>
-
- <!-- locales a utiliser pour construire le site -->
- <maven.site.locales>fr</maven.site.locales>
-
+ <helper.version>1.0.0-SNAPSHOT</helper.version>
+ <helper.licenseName>lgpl_v3</helper.licenseName>
+ <site.home.url>http://lutinprocessor.labs.libre-entreprise.org/nuitonprocessor</site.home.url>
+ <repository.home.url>http://lutinbuilder.labs.libre-entreprise.org/maven2</repository.home.url>
</properties>
<build>
@@ -67,7 +74,7 @@
<descriptor>src/main/assembly/deps.xml</descriptor>
<descriptor>src/main/assembly/full.xml</descriptor>
</descriptors>
- </configuration>
+ </configuration>
</plugin>
<plugin>
@@ -76,7 +83,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>doxia-module-jrst</artifactId>
- <version>1.0.0</version>
+ <version>1.0.1</version>
</dependency>
</dependencies>
</plugin>
@@ -89,7 +96,10 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
+<!-- a supprimer -->
+
<!--Source control management-->
+
<scm>
<connection>${maven.scm.connection}</connection>
<developerConnection>${maven.scm.developerConnection}</developerConnection>
@@ -113,8 +123,8 @@
</repository>
</repositories>
+ <!-- perform only on a release stage when using the maven-release-plugin -->
<profiles>
- <!-- perform only on a release stage when using the maven-release-plugin -->
<profile>
<id>release-profile</id>
<activation>
@@ -126,20 +136,17 @@
<build>
<plugins>
- <!-- always add license and third-party files to classpath -->
+
<plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-license-switcher-plugin</artifactId>
- <version>0.8</version>
- <configuration>
- <licenseName>${license-switcher.licenseName}</licenseName>
- </configuration>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-helper-plugin</artifactId>
+ <version>${helper.version}</version>
<executions>
<execution>
<id>attach-licenses</id>
<goals>
- <goal>license</goal>
- <goal>third-party</goal>
+ <goal>add-license</goal>
+ <goal>add-third-party</goal>
</goals>
</execution>
</executions>
Modified: nuitonprocessor/trunk/src/site/site.xml
===================================================================
--- nuitonprocessor/trunk/src/site/site.xml 2009-05-11 02:59:13 UTC (rev 202)
+++ nuitonprocessor/trunk/src/site/site.xml 2009-05-13 16:04:45 UTC (rev 203)
@@ -1,46 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="${project.name}">
- <publishDate format="dd/MM/yyyy"/>
+ <publishDate format="dd/MM/yyyy"/>
- <skin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-lutin-skin</artifactId>
- <version>0.2.3</version>
- </skin>
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.3</version>
+ </skin>
- <bannerLeft>
- <name>${project.name}</name>
- </bannerLeft>
+ <bannerLeft>
+ <name>${project.name}</name>
+ </bannerLeft>
- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>http://www.codelutin.com</href>
- </bannerRight>
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
- <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="images/restructuredtext-logo.png"/>
- </poweredBy>
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="images/restructuredtext-logo.png"/>
+ </poweredBy>
- <body>
- <links>
- <item name="Maven-processor-plugin" href="http://lutinprocessor.labs.libre-entreprise.org/maven-processor-plugin/"/>
- <item name="Labs" href="http://labs.libre-entreprise.org/"/>
- <item name="${project.organization.name}" href="${project.organization.url}"/>
- </links>
+ <body>
+ <links>
+ <item name="Maven-processor-plugin" href="http://lutinprocessor.labs.libre-entreprise.org/maven-processor-plugin/"/>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="${project.organization.name}" href="${project.organization.url}"/>
+ </links>
- <menu name="Utilisateur">
- <item href="/index.html" name="Accueil"/>
- <item href="http://lutinbuilder.labs.libre-entreprise.org/maven2/org/codelutin/${projec…" name="Téléchargement"/>
- </menu>
+ <menu name="Utilisateur">
+ <item href="/index.html" name="Accueil"/>
+ <item href="http://lutinbuilder.labs.libre-entreprise.org/maven2/org/codelutin/${projec…" name="Téléchargement"/>
+ </menu>
- <menu name="Developpeur">
- <item name="Todo" href="Todo.html"/>
- </menu>
+ <menu name="Téléchargement">
+ <item href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ </menu>
+
+ <menu name="Developpeur">
+ <item name="Todo" href="Todo.html"/>
+ </menu>
- <menu ref="reports"/>
+ <menu ref="reports"/>
- </body>
+ </body>
</project>
1
0
[Lutinprocessor-commits] r202 - maven-processor-plugin/trunk
by tchemit@users.labs.libre-entreprise.org 11 May '09
by tchemit@users.labs.libre-entreprise.org 11 May '09
11 May '09
Author: tchemit
Date: 2009-05-11 02:59:13 +0000 (Mon, 11 May 2009)
New Revision: 202
Modified:
maven-processor-plugin/trunk/pom.xml
Log:
push back scm generic values
Modified: maven-processor-plugin/trunk/pom.xml
===================================================================
--- maven-processor-plugin/trunk/pom.xml 2009-05-11 02:48:51 UTC (rev 201)
+++ maven-processor-plugin/trunk/pom.xml 2009-05-11 02:59:13 UTC (rev 202)
@@ -147,9 +147,9 @@
<!--Source control management-->
<scm>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/maven-processor…</url>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/trunk</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/trunk</developerConnection>
+ <url>${maven.scm.url}</url>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
</scm>
<!--Code Lutin Repository-->
1
0
Author: tchemit
Date: 2009-05-11 02:48:51 +0000 (Mon, 11 May 2009)
New Revision: 201
Added:
nuitonprocessor/
Log:
migrate to nuiton
Copied: nuitonprocessor (from rev 200, lutinprocessor)
1
0
[Lutinprocessor-commits] r200 - maven-processor-plugin/trunk
by tchemit@users.labs.libre-entreprise.org 11 May '09
by tchemit@users.labs.libre-entreprise.org 11 May '09
11 May '09
Author: tchemit
Date: 2009-05-11 02:32:29 +0000 (Mon, 11 May 2009)
New Revision: 200
Modified:
maven-processor-plugin/trunk/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: maven-processor-plugin/trunk/pom.xml
===================================================================
--- maven-processor-plugin/trunk/pom.xml 2009-05-11 02:32:26 UTC (rev 199)
+++ maven-processor-plugin/trunk/pom.xml 2009-05-11 02:32:29 UTC (rev 200)
@@ -14,7 +14,7 @@
</parent>
<artifactId>maven-processor-plugin</artifactId>
- <version>0.18</version>
+ <version>1.0.0-SNAPSHOT</version>
<dependencies>
@@ -147,9 +147,9 @@
<!--Source control management-->
<scm>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/maven-processor…</url>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/tags/0.18</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/tags/0.18</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/maven-processor…</url>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/trunk</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/trunk</developerConnection>
</scm>
<!--Code Lutin Repository-->
1
0
[Lutinprocessor-commits] r199 - maven-processor-plugin/tags
by tchemit@users.labs.libre-entreprise.org 11 May '09
by tchemit@users.labs.libre-entreprise.org 11 May '09
11 May '09
Author: tchemit
Date: 2009-05-11 02:32:26 +0000 (Mon, 11 May 2009)
New Revision: 199
Added:
maven-processor-plugin/tags/0.18/
Log:
[maven-scm] copy for tag 0.18
Copied: maven-processor-plugin/tags/0.18 (from rev 198, maven-processor-plugin/trunk)
1
0
[Lutinprocessor-commits] r198 - maven-processor-plugin/trunk
by tchemit@users.labs.libre-entreprise.org 11 May '09
by tchemit@users.labs.libre-entreprise.org 11 May '09
11 May '09
Author: tchemit
Date: 2009-05-11 02:32:20 +0000 (Mon, 11 May 2009)
New Revision: 198
Modified:
maven-processor-plugin/trunk/pom.xml
Log:
[maven-release-plugin] prepare release 0.18
Modified: maven-processor-plugin/trunk/pom.xml
===================================================================
--- maven-processor-plugin/trunk/pom.xml 2009-05-11 02:31:31 UTC (rev 197)
+++ maven-processor-plugin/trunk/pom.xml 2009-05-11 02:32:20 UTC (rev 198)
@@ -14,7 +14,7 @@
</parent>
<artifactId>maven-processor-plugin</artifactId>
- <version>0.18-SNAPSHOT</version>
+ <version>0.18</version>
<dependencies>
@@ -147,9 +147,9 @@
<!--Source control management-->
<scm>
- <url>${maven.scm.url}</url>
- <connection>${maven.scm.connection}</connection>
- <developerConnection>${maven.scm.developerConnection}</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/maven-processor…</url>
+ <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/tags/0.18</connection>
+ <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/tags/0.18</developerConnection>
</scm>
<!--Code Lutin Repository-->
1
0
[Lutinprocessor-commits] r197 - in maven-processor-plugin/trunk: . src/main/java/org/codelutin/processor/plugin src/site
by tchemit@users.labs.libre-entreprise.org 11 May '09
by tchemit@users.labs.libre-entreprise.org 11 May '09
11 May '09
Author: tchemit
Date: 2009-05-11 02:31:31 +0000 (Mon, 11 May 2009)
New Revision: 197
Modified:
maven-processor-plugin/trunk/changelog.txt
maven-processor-plugin/trunk/pom.xml
maven-processor-plugin/trunk/src/main/java/org/codelutin/processor/plugin/ProcessorPlugin.java
maven-processor-plugin/trunk/src/site/site.xml
Log:
* bump versions (lutinproject, lutinprocessor, maven-license-switcher-plugin)
* improve download section on site
* update site
Modified: maven-processor-plugin/trunk/changelog.txt
===================================================================
--- maven-processor-plugin/trunk/changelog.txt 2009-05-10 23:44:42 UTC (rev 196)
+++ maven-processor-plugin/trunk/changelog.txt 2009-05-11 02:31:31 UTC (rev 197)
@@ -1,3 +1,8 @@
+ver-0-18 chemit (20090511)
+ * bump versions (lutinproject, lutinprocessor, maven-license-switcher-plugin)
+ * improve download section on site
+ * update site
+
ver-0-17 chemit (20090218)
* Parent is org.codelutin:lutinproject:3.4
* use same version as maven-processor-plugin
Modified: maven-processor-plugin/trunk/pom.xml
===================================================================
--- maven-processor-plugin/trunk/pom.xml 2009-05-10 23:44:42 UTC (rev 196)
+++ maven-processor-plugin/trunk/pom.xml 2009-05-11 02:31:31 UTC (rev 197)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.4</version>
+ <version>3.5.4</version>
</parent>
<artifactId>maven-processor-plugin</artifactId>
@@ -21,14 +21,14 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinprocessor</artifactId>
- <version>0.18-SNAPSHOT</version>
+ <version>0.18</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinpluginutil</artifactId>
- <version>${lutinpluginutil.version}</version>
+ <version>0.5</version>
<scope>compile</scope>
</dependency>
@@ -81,13 +81,9 @@
<packaging>maven-plugin</packaging>
<properties>
- <!-- id du projet du labs -->
+
<labs.id>28</labs.id>
-
- <!-- nom du projet sur le labs -->
<labs.project>lutinprocessor</labs.project>
-
- <lutinpluginutil.version>0.3</lutinpluginutil.version>
<maven.version>2.0.10</maven.version>
</properties>
@@ -100,7 +96,6 @@
<!-- plugin plugin -->
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
- <version>2.4.3</version>
<executions>
<execution>
<goals>
@@ -110,28 +105,29 @@
</executions>
</plugin>
- <!-- Always process jrst files, but only called on pre-site phase -->
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-jrst-plugin</artifactId>
- <version>0.8.4</version>
- <configuration>
- <directoryIn>${maven.src.dir}/site</directoryIn>
- <directoryOut>${maven.site.gen.dir}</directoryOut>
- <defaultLocale>fr</defaultLocale>
- <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
- <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
- </configuration>
- <executions>
- <execution>
- <phase>pre-site</phase>
- <goals>
- <goal>jrst</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
+
+ <pluginManagement>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>doxia-module-jrst</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
</build>
<!--Site-->
@@ -140,6 +136,7 @@
<!--Site report's plugin-->
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
+ <version>2.5</version>
</plugin>
</plugins>
</reporting>
@@ -150,9 +147,9 @@
<!--Source control management-->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/trunk</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/lutinprocessor/maven-processor-plugin/trunk</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/maven-processor…</url>
+ <url>${maven.scm.url}</url>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
</scm>
<!--Code Lutin Repository-->
@@ -188,10 +185,7 @@
<plugin>
<groupId>org.codelutin</groupId>
<artifactId>maven-license-switcher-plugin</artifactId>
- <version>0.6</version>
- <configuration>
- <licenseName>${license-switcher.licenseName}</licenseName>
- </configuration>
+ <version>0.8</version>
<executions>
<execution>
<id>attach-licenses</id>
Modified: maven-processor-plugin/trunk/src/main/java/org/codelutin/processor/plugin/ProcessorPlugin.java
===================================================================
--- maven-processor-plugin/trunk/src/main/java/org/codelutin/processor/plugin/ProcessorPlugin.java 2009-05-10 23:44:42 UTC (rev 196)
+++ maven-processor-plugin/trunk/src/main/java/org/codelutin/processor/plugin/ProcessorPlugin.java 2009-05-11 02:31:31 UTC (rev 197)
@@ -130,6 +130,7 @@
*/
protected boolean addCompileDirectory;
+ @Override
public void execute() throws MojoExecutionException {
getLog().info("Génération des fichiers à partir de lutin processor");
Modified: maven-processor-plugin/trunk/src/site/site.xml
===================================================================
--- maven-processor-plugin/trunk/src/site/site.xml 2009-05-10 23:44:42 UTC (rev 196)
+++ maven-processor-plugin/trunk/src/site/site.xml 2009-05-11 02:31:31 UTC (rev 197)
@@ -1,46 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="MavenProcessorPlugin">
+<project name="${project.name}">
- <publishDate format="dd/MM/yyyy"/>
+ <publishDate format="dd/MM/yyyy"/>
- <skin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-lutin-skin</artifactId>
- <version>0.2.3</version>
- </skin>
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.3</version>
+ </skin>
- <bannerLeft>
- <name>Maven-Processor-Plugin</name>
- </bannerLeft>
+ <bannerLeft>
+ <name>Maven-Processor-Plugin</name>
+ </bannerLeft>
- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>http://www.codelutin.com</href>
- </bannerRight>
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
- <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="images/restructuredtext-logo.png"/>
- </poweredBy>
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="images/restructuredtext-logo.png"/>
+ </poweredBy>
- <body>
- <links>
- <item name="LutinProcessor" href="http://lutinprocessor.labs.libre-entreprise.org/"/>
- <item name="Labs" href="http://labs.libre-entreprise.org/"/>
- <item name="Code Lutin" href="http://www.codelutin.com/"/>
- </links>
+ <body>
+ <links>
+ <item name="LutinProcessor" href="http://lutinprocessor.labs.libre-entreprise.org/"/>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="Code Lutin" href="http://www.codelutin.com/"/>
+ </links>
- <menu name="Utilisateur">
- <item href="index.html" name="Accueil"/>
- <item href="http://lutinbuilder.labs.libre-entreprise.org/maven2/org/codelutin/maven-pr…" name="Téléchargement"/>
- </menu>
+ <menu name="Utilisateur">
+ <item href="index.html" name="Accueil"/>
+ <item name="Goals" href="plugin-info.html">
+ <item name="process" href="process-mojo.html"/>
+ <item name="help" href="help-mojo.html"/>
+ </item>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${labs.builder.url}/org/codelutin/${project.artifactId}/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ </menu>
- <!--<menu name="Developpeur">
- <item name="Todo" href="Todo.html"/>
- </menu>-->
-
- ${reports}
+ <menu ref="reports"/>
- </body>
+ </body>
</project>
1
0
[Lutinprocessor-commits] r196 - lutinprocessor/trunk/src/site
by tchemit@users.labs.libre-entreprise.org 10 May '09
by tchemit@users.labs.libre-entreprise.org 10 May '09
10 May '09
Author: tchemit
Date: 2009-05-10 23:44:42 +0000 (Sun, 10 May 2009)
New Revision: 196
Added:
lutinprocessor/trunk/src/site/site.xml
Removed:
lutinprocessor/trunk/src/site/site_fr.xml
Log:
default locale is fr
Copied: lutinprocessor/trunk/src/site/site.xml (from rev 188, lutinprocessor/trunk/src/site/site_fr.xml)
===================================================================
--- lutinprocessor/trunk/src/site/site.xml (rev 0)
+++ lutinprocessor/trunk/src/site/site.xml 2009-05-10 23:44:42 UTC (rev 196)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <publishDate format="dd/MM/yyyy"/>
+
+ <skin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-lutin-skin</artifactId>
+ <version>0.2.3</version>
+ </skin>
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
+ <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="Maven-processor-plugin" href="http://lutinprocessor.labs.libre-entreprise.org/maven-processor-plugin/"/>
+ <item name="Labs" href="http://labs.libre-entreprise.org/"/>
+ <item name="${project.organization.name}" href="${project.organization.url}"/>
+ </links>
+
+ <menu name="Utilisateur">
+ <item href="/index.html" name="Accueil"/>
+ <item href="http://lutinbuilder.labs.libre-entreprise.org/maven2/org/codelutin/${projec…" name="Téléchargement"/>
+ </menu>
+
+ <menu name="Developpeur">
+ <item name="Todo" href="Todo.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Deleted: lutinprocessor/trunk/src/site/site_fr.xml
===================================================================
--- lutinprocessor/trunk/src/site/site_fr.xml 2009-05-10 17:28:58 UTC (rev 195)
+++ lutinprocessor/trunk/src/site/site_fr.xml 2009-05-10 23:44:42 UTC (rev 196)
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <publishDate format="dd/MM/yyyy"/>
-
- <skin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-lutin-skin</artifactId>
- <version>0.2.3</version>
- </skin>
-
- <bannerLeft>
- <name>${project.name}</name>
- </bannerLeft>
-
- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>http://www.codelutin.com</href>
- </bannerRight>
-
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/>
- <logo href="http://jrst.labs.libre-entreprise.org" name="JRst" img="images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="images/restructuredtext-logo.png"/>
- </poweredBy>
-
- <body>
- <links>
- <item name="Maven-processor-plugin" href="http://lutinprocessor.labs.libre-entreprise.org/maven-processor-plugin/"/>
- <item name="Labs" href="http://labs.libre-entreprise.org/"/>
- <item name="${project.organization.name}" href="${project.organization.url}"/>
- </links>
-
- <menu name="Utilisateur">
- <item href="/index.html" name="Accueil"/>
- <item href="http://lutinbuilder.labs.libre-entreprise.org/maven2/org/codelutin/${projec…" name="Téléchargement"/>
- </menu>
-
- <menu name="Developpeur">
- <item name="Todo" href="Todo.html"/>
- </menu>
-
- <menu ref="reports"/>
-
- </body>
-</project>
1
0
[Lutinprocessor-commits] r195 - lutinprocessor/trunk
by tchemit@users.labs.libre-entreprise.org 10 May '09
by tchemit@users.labs.libre-entreprise.org 10 May '09
10 May '09
Author: tchemit
Date: 2009-05-10 17:28:58 +0000 (Sun, 10 May 2009)
New Revision: 195
Modified:
lutinprocessor/trunk/pom.xml
Log:
push back scm generic values
Modified: lutinprocessor/trunk/pom.xml
===================================================================
--- lutinprocessor/trunk/pom.xml 2009-05-10 17:19:48 UTC (rev 194)
+++ lutinprocessor/trunk/pom.xml 2009-05-10 17:28:58 UTC (rev 195)
@@ -91,9 +91,9 @@
<!--Source control management-->
<scm>
- <connection>scm:svn:svn://anonymous@labs.libre-entreprise.org/svnroot/lutinprocessor/lutinprocessor/trunk</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit@labs.libre-entreprise.org/svnroot/lutinprocessor/lutinprocessor/trunk</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/lutinprocessor/…</url>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
+ <url>${maven.scm.url}</url>
</scm>
<!--Code Lutin Repository-->
1
0