diff --git a/.gitignore b/.gitignore index 3558c56..7f48608 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bin/ build/ +target/ diff --git a/build.properties b/build.properties deleted file mode 100644 index ff33983..0000000 --- a/build.properties +++ /dev/null @@ -1 +0,0 @@ -version=1.4.2.1 diff --git a/build.xml b/build.xml deleted file mode 100755 index 9d0136a..0000000 --- a/build.xml +++ /dev/null @@ -1,757 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Not skipping doclet run... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
-
- - - -
-
- - - - - - - - - - - - - - - -
- - - - - - -
-
- - - -
-
- - - - - - - - - - - - - - - - - - -
- - - - - - -
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/develjar/ant-contrib-1.0b3.jar b/develjar/ant-contrib-1.0b3.jar deleted file mode 100644 index 0625376..0000000 Binary files a/develjar/ant-contrib-1.0b3.jar and /dev/null differ diff --git a/develjar/com-sun-javadoc.jar b/develjar/com-sun-javadoc.jar deleted file mode 100644 index bde0623..0000000 Binary files a/develjar/com-sun-javadoc.jar and /dev/null differ diff --git a/develjar/com-sun-tools-doclets-Taglet.jar b/develjar/com-sun-tools-doclets-Taglet.jar deleted file mode 100644 index 340e50b..0000000 Binary files a/develjar/com-sun-tools-doclets-Taglet.jar and /dev/null differ diff --git a/develjar/junit-4.3.1.jar b/develjar/junit-4.3.1.jar deleted file mode 100644 index ff5d188..0000000 Binary files a/develjar/junit-4.3.1.jar and /dev/null differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5a3e47a --- /dev/null +++ b/pom.xml @@ -0,0 +1,186 @@ + + 4.0.0 + + org.openscience.cdk + cdk-chemojava + 1.5.0 + jar + ChemoJava + CDK extensions with GPL-licensed code + + + UTF-8 + UTF-8 + 11 + 11 + + + + + org.openscience.cdk + cdk-qsar + 2.5 + + + nz.ac.waikato.cms.weka + weka-stable + 3.6.6 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + @{argLine} -Djava.awt.headless=true -Dcdk.logging.level=ERROR + + + **/TestMoleculeFactory.java + + **/cdk/limitations/** + + **/*CoverageTest.java + + **/modulesuites/M*Tests.java + + **/io/formats/*FormatTest.java + + org.openscience.cdk.SlowTest + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + true + + + + true + true + + + + + + + test-jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + + + cdk.set + a + + Belongs to the set: + + + cdk.keyword + a + + Keywords: + + + cdk.created + a + + Created on: + + + cdk.require + a + + Requires: + + + cdk.todo + a + + To do: + + + cdk.license + a + + License: + + + + + net.sf.cdk.tools.doclets.CDKCiteTaglet + + + net.sf.cdk.tools.doclets.CDKBugTaglet + + + net.sf.cdk.tools.doclets.CDKDictRefTaglet + + + net.sf.cdk.tools.doclets.CDKGitTaglet + + + net.sf.cdk.tools.doclets.CDKInChITaglet + + + net.sf.cdk.tools.doclets.CDKIOOptionsTaglet + + + net.sf.cdk.tools.doclets.CDKModuleTaglet + + + net.sf.cdk.tools.doclets.CDKThreadSafeTaglet + + + net.sf.cdk.tools.doclets.CDKThreadNonSafeTaglet + + + + + org.openscience.cdk + cdk-build-utils + 1.0.2.8 + + false + ChemoJava ${project.version} API + ${basedir}/doc/javadoc/stylesheet.css + + + + aggregate + + aggregate + + site + + + + + + + + + diff --git a/src/main/org/openscience/cdk/qsar/model/IModel.java b/src/main/java/org/openscience/cdk/qsar/model/IModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/IModel.java rename to src/main/java/org/openscience/cdk/qsar/model/IModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/QSARModelException.java b/src/main/java/org/openscience/cdk/qsar/model/QSARModelException.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/QSARModelException.java rename to src/main/java/org/openscience/cdk/qsar/model/QSARModelException.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNClassificationModel.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNClassificationModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNClassificationModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNClassificationModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNClassificationModelFit.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNClassificationModelFit.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNClassificationModelFit.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNClassificationModelFit.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNClassificationModelPredict.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNClassificationModelPredict.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNClassificationModelPredict.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNClassificationModelPredict.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModel.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModelFit.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModelFit.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModelFit.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModelFit.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModelPredict.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModelPredict.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModelPredict.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModelPredict.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModelSummary.java b/src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModelSummary.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/CNNRegressionModelSummary.java rename to src/main/java/org/openscience/cdk/qsar/model/R/CNNRegressionModelSummary.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModel.java b/src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModelFit.java b/src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModelFit.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModelFit.java rename to src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModelFit.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModelPredict.java b/src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModelPredict.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModelPredict.java rename to src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModelPredict.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModelSummary.java b/src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModelSummary.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/LinearRegressionModelSummary.java rename to src/main/java/org/openscience/cdk/qsar/model/R/LinearRegressionModelSummary.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/PLSRegressionModel.java b/src/main/java/org/openscience/cdk/qsar/model/R/PLSRegressionModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/PLSRegressionModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R/PLSRegressionModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/PLSRegressionModelFit.java b/src/main/java/org/openscience/cdk/qsar/model/R/PLSRegressionModelFit.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/PLSRegressionModelFit.java rename to src/main/java/org/openscience/cdk/qsar/model/R/PLSRegressionModelFit.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/PLSRegressionModelPredict.java b/src/main/java/org/openscience/cdk/qsar/model/R/PLSRegressionModelPredict.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/PLSRegressionModelPredict.java rename to src/main/java/org/openscience/cdk/qsar/model/R/PLSRegressionModelPredict.java diff --git a/src/main/org/openscience/cdk/qsar/model/R/RModel.java b/src/main/java/org/openscience/cdk/qsar/model/R/RModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R/RModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R/RModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R2/CNNRegressionModel.java b/src/main/java/org/openscience/cdk/qsar/model/R2/CNNRegressionModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R2/CNNRegressionModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R2/CNNRegressionModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R2/LinearRegressionModel.java b/src/main/java/org/openscience/cdk/qsar/model/R2/LinearRegressionModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R2/LinearRegressionModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R2/LinearRegressionModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/R2/RModel.java b/src/main/java/org/openscience/cdk/qsar/model/R2/RModel.java similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/R2/RModel.java rename to src/main/java/org/openscience/cdk/qsar/model/R2/RModel.java diff --git a/src/main/org/openscience/cdk/qsar/model/data/cdkSJava.R b/src/main/java/org/openscience/cdk/qsar/model/data/cdkSJava.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/cdkSJava.R rename to src/main/java/org/openscience/cdk/qsar/model/data/cdkSJava.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/cnn_3.R b/src/main/java/org/openscience/cdk/qsar/model/data/cnn_3.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/cnn_3.R rename to src/main/java/org/openscience/cdk/qsar/model/data/cnn_3.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/cnn_4.R b/src/main/java/org/openscience/cdk/qsar/model/data/cnn_4.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/cnn_4.R rename to src/main/java/org/openscience/cdk/qsar/model/data/cnn_4.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/helper.R b/src/main/java/org/openscience/cdk/qsar/model/data/helper.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/helper.R rename to src/main/java/org/openscience/cdk/qsar/model/data/helper.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/init_1.R b/src/main/java/org/openscience/cdk/qsar/model/data/init_1.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/init_1.R rename to src/main/java/org/openscience/cdk/qsar/model/data/init_1.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/lm_2.R b/src/main/java/org/openscience/cdk/qsar/model/data/lm_2.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/lm_2.R rename to src/main/java/org/openscience/cdk/qsar/model/data/lm_2.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/pls_5.R b/src/main/java/org/openscience/cdk/qsar/model/data/pls_5.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/pls_5.R rename to src/main/java/org/openscience/cdk/qsar/model/data/pls_5.R diff --git a/src/main/org/openscience/cdk/qsar/model/data/register_999.R b/src/main/java/org/openscience/cdk/qsar/model/data/register_999.R similarity index 100% rename from src/main/org/openscience/cdk/qsar/model/data/register_999.R rename to src/main/java/org/openscience/cdk/qsar/model/data/register_999.R diff --git a/src/main/org/openscience/chemojava/libio/openbabel/OpenBabelConvert.java b/src/main/java/org/openscience/chemojava/libio/openbabel/OpenBabelConvert.java similarity index 100% rename from src/main/org/openscience/chemojava/libio/openbabel/OpenBabelConvert.java rename to src/main/java/org/openscience/chemojava/libio/openbabel/OpenBabelConvert.java diff --git a/src/main/org/openscience/chemojava/libio/weka/Weka.java b/src/main/java/org/openscience/chemojava/libio/weka/Weka.java similarity index 100% rename from src/main/org/openscience/chemojava/libio/weka/Weka.java rename to src/main/java/org/openscience/chemojava/libio/weka/Weka.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/DensityBasedClustererModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/DensityBasedClustererModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/DensityBasedClustererModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/DensityBasedClustererModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/EMCluster.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/EMCluster.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/EMCluster.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/EMCluster.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/FilterSupervisedResample.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/FilterSupervisedResample.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/FilterSupervisedResample.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/FilterSupervisedResample.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedRandomize.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedRandomize.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedRandomize.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedRandomize.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedResample.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedResample.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedResample.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/FilterUnSupervisedResample.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/IWekaModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/IWekaModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/IWekaModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/IWekaModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/J48WModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/J48WModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/J48WModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/J48WModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/KmeansCluster.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/KmeansCluster.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/KmeansCluster.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/KmeansCluster.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/LinearRegressionWModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/LinearRegressionWModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/LinearRegressionWModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/LinearRegressionWModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/MultilayerPerceptronModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/MultilayerPerceptronModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/MultilayerPerceptronModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/MultilayerPerceptronModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/NaiveBayesModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/NaiveBayesModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/NaiveBayesModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/NaiveBayesModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/SMOModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/SMOModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/SMOModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/SMOModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/SMOregModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/SMOregModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/SMOregModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/SMOregModel.java diff --git a/src/main/org/openscience/chemojava/qsar/model/weka/SimpleLinearRegressionModel.java b/src/main/java/org/openscience/chemojava/qsar/model/weka/SimpleLinearRegressionModel.java similarity index 100% rename from src/main/org/openscience/chemojava/qsar/model/weka/SimpleLinearRegressionModel.java rename to src/main/java/org/openscience/chemojava/qsar/model/weka/SimpleLinearRegressionModel.java diff --git a/src/main/net/sf/cdk/tools/MakeJavafilesFiles.java b/src/main/net/sf/cdk/tools/MakeJavafilesFiles.java deleted file mode 100644 index f32ab63..0000000 --- a/src/main/net/sf/cdk/tools/MakeJavafilesFiles.java +++ /dev/null @@ -1,294 +0,0 @@ -/* $Revision: 6707 $ $Author: egonw $ $Date: 2006-07-30 16:38:18 -0400 (Sun, 30 Jul 2006) $ - * - * Copyright (C) 2006 Egon Willighagen - * - * Contact: cdk-devel@lists.sourceforge.net - * - * 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 2.1 - * of the License, or (at your option) any later version. - * All we ask is that proper credit is given for our work, which includes - * - but is not limited to - adding the above copyright notice to the beginning - * of your source code files, and to any copyright notice that you may distribute - * with programs based on this work. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package net.sf.cdk.tools; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * Class that creates the ${build}/*.javafiles. - * - * @author egonw - */ -public class MakeJavafilesFiles { - - private Map> cdkPackages; - private Map> cdkSets; - - /** Java files that should not be processed because they are - * listed in a *.autogenerated file. - */ - private List blacklist; - - private String sourceDir = null; - private String outputDir = null; - private String metainfDir = null; - - public MakeJavafilesFiles(String metainfDir, String sourceDir, String outputDir) { - cdkPackages = new Hashtable>(); - cdkSets = new Hashtable>(); - this.sourceDir = sourceDir; - this.outputDir = outputDir; - this.metainfDir = metainfDir; - readBlackList(); - } - - private void readBlackList() { - blacklist = new ArrayList(); - String metainfDirPath = this.metainfDir; - File metinfDir = new File(metainfDirPath); - File[] files = metinfDir.listFiles(); - for (int i=0; i 0) - blacklist.add(line); - line = reader.readLine(); - } - } catch (Exception e) { - System.out.println("Error reading a *.autogenerated file: " + e.getMessage()); - e.printStackTrace(); - System.exit(1); - } - } - } - - } - - public void outputResults() { - // output information in .javafiles and .classes files - try { - Iterator keys = cdkPackages.keySet().iterator(); - while (keys.hasNext()) { - String key = (String)keys.next(); - - // create one file for each cdk package = key - PrintWriter outJava = new PrintWriter( - new FileWriter(outputDir + "/" + key + ".javafiles") - ); - PrintWriter outClass = new PrintWriter( - new FileWriter(outputDir + "/" + key + ".classes") - ); - List packageClasses = cdkPackages.get(key); - Iterator classes = packageClasses.iterator(); - while (classes.hasNext()) { - String packageClass = toAPIPath(classes.next()); - if (!blacklist.contains(packageClass + ".java")) { - outJava.println(packageClass + ".java"); - outClass.println(packageClass + "*.class"); - } - } - outJava.flush(); outJava.close(); - outClass.flush(); outClass.close(); - } - // output information in .set files - keys = cdkSets.keySet().iterator(); - while (keys.hasNext()) { - String key = (String)keys.next(); - - // create one file for each cdk package = key - PrintWriter outJava = new PrintWriter( - new FileWriter(outputDir + "/" + key + ".set") - ); - List packageClasses = cdkSets.get(key); - Iterator classes = packageClasses.iterator(); - while (classes.hasNext()) { - String packageClass = (String)classes.next(); - outJava.println(packageClass); - } - outJava.flush(); outJava.close(); - } - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public void processJavaSourceFiles(File path) { - if (path.isDirectory()) { - File[] files = path.listFiles(); - for (int i=files.length;i>0;i--) { - processJavaSourceFiles(files[i-1]); - } - } else if (path.isFile() && path.getPath().endsWith(".java") && - !(path.getPath().indexOf("net/sf") != -1 || - path.getPath().indexOf("net\\sf") != -1)) { - String[] moduleAndSet = getModuleAndSet(path); - if (moduleAndSet == null) { - System.out.println("Something wrong with the Java source file: " + path); - } else { - if (moduleAndSet[0] != null) { - addClassToCDKPackage(getSourceName(path), moduleAndSet[0]); - } - if (moduleAndSet[1] != null) { - addClassToCDKSet(getClassName(path), moduleAndSet[1]); - } - } - } - } - - public String[] getModuleAndSet(File file) { - try { - String[] results = new String[2]; - results[0] = "extra"; - results[1] = null; - BufferedReader reader = new BufferedReader( - new FileReader(file) - ); - String line = null; - boolean inComment = false; - while ((line = reader.readLine()) != null) { - int index = line.indexOf("/**"); - if (index != -1) { - inComment = true; - if (line.substring(index).indexOf("**/") != -1) inComment = false; - } else { - if (line.indexOf("*/") != -1) inComment = false; - } - - if (!inComment && (line.indexOf("public class") != -1 || - line.indexOf("public interface") != -1 || - line.indexOf("public @interface") != -1 || - line.indexOf("abstract class") != -1 || - line.indexOf("final class") != -1)) { - // Nothing specified: return the default 'extra' - reader.close(); - return results; - } - - index = line.indexOf("@cdk.module"); - String name = ""; - if (index != -1) { - index += 11; - // skip the first chars - while (Character.isWhitespace(line.charAt(index))) index++; - while (index < line.length() && - !Character.isWhitespace(line.charAt(index))) { - name += line.charAt(index); - index++; - } - results[0] = name; - } else { - index = line.indexOf("@cdk.set"); - String set = ""; - if (index != -1) { - index += 11; - // skip the first chars - while (Character.isWhitespace(line.charAt(index))) index++; - while (index < line.length() && - !Character.isWhitespace(line.charAt(index))) { - set += line.charAt(index); - index++; - } - results[1] = set; - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - public static void main(String[] args) { - if (args.length != 3) { - System.out.println("Syntax: MakeJavafilesFiles "); - System.exit(-1); - } - - MakeJavafilesFiles processor = new MakeJavafilesFiles(args[0], args[1], args[2]); - - processor.processJavaSourceFiles(new File(args[1])); - processor.outputResults(); - - } - - private String toAPIPath(String className) { - StringBuffer sb = new StringBuffer(); - for (int i=0; i packageClasses = cdkPackages.get(cdkPackageName); - if (packageClasses == null) { - packageClasses = new ArrayList(); - cdkPackages.put(cdkPackageName, packageClasses); - } - packageClasses.add(packageClass); - } - - private void addClassToCDKSet(String packageClass, String cdkPackageName) { - List packageClasses = cdkSets.get(cdkPackageName); - if (packageClasses == null) { - packageClasses = new ArrayList(); - cdkSets.put(cdkPackageName, packageClasses); - } - packageClasses.add(packageClass); - } - -} diff --git a/src/main/net/sf/cdk/tools/bibtex/BibTeXMLEntry.java b/src/main/net/sf/cdk/tools/bibtex/BibTeXMLEntry.java deleted file mode 100644 index 60104da..0000000 --- a/src/main/net/sf/cdk/tools/bibtex/BibTeXMLEntry.java +++ /dev/null @@ -1,106 +0,0 @@ -/* $Revision: 6707 $ $Author: egonw $ $Date: 2006-07-30 16:38:18 -0400 (Sun, 30 Jul 2006) $ - * - * Copyright (C) 2007 Egon Willighagen - * - * Contact: cdk-devel@lists.sourceforge.net - * - * 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 2.1 - * of the License, or (at your option) any later version. - * All we ask is that proper credit is given for our work, which includes - * - but is not limited to - adding the above copyright notice to the beginning - * of your source code files, and to any copyright notice that you may distribute - * with programs based on this work. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package net.sf.cdk.tools.bibtex; - -import nu.xom.Element; -import nu.xom.Node; -import nu.xom.Nodes; -import nu.xom.XPathContext; - -/** - * This is a tool that creates HTML for a subset of the entry types - * defined in BibTeXML. It expects the document to be valid according to - * the BibTeXML schema, or will fail horribly. - * - * @author egonw - */ -public class BibTeXMLEntry { - - private Node entry; - private XPathContext context; - - public BibTeXMLEntry(Node entry) { - this.entry = entry; - context = new XPathContext("bibtex", BibTeXMLFile.BIBTEXML_NAMESPACE); - context.addNamespace("b", BibTeXMLFile.BIBTEXML_NAMESPACE); - } - - /** - * The style is undefined and just made to look nice. - */ - public String toHTML() { - // b:article - Nodes results = entry.query("./b:article", context); - for (int i=0; i").append(title).append(", "); - buffer.append(journal).append(", ").append(year).append(", "); - buffer.append(volume).append(":").append(pages); - return buffer.toString(); - } - - protected String formatMisc(String authors, String title) { - StringBuffer buffer = new StringBuffer(); - buffer.append(authors).append(", ").append(title).append(""); - return buffer.toString(); - } - - /** - * @param node Parent for the child. - * @param childElement Localname of the child element. - * @param def String to default to if no child element is found. - * @return String value for the child node. - */ - private String getString(Node node, String childElement, String def) { - Nodes result = node.query("./b:" + childElement, context); - return result.size() > 0 ? ((Element)result.get(0)).getValue() : def; - } - -} diff --git a/src/main/net/sf/cdk/tools/bibtex/BibTeXMLFile.java b/src/main/net/sf/cdk/tools/bibtex/BibTeXMLFile.java deleted file mode 100644 index 61e8548..0000000 --- a/src/main/net/sf/cdk/tools/bibtex/BibTeXMLFile.java +++ /dev/null @@ -1,75 +0,0 @@ -/* $Revision: 6707 $ $Author: egonw $ $Date: 2006-07-30 16:38:18 -0400 (Sun, 30 Jul 2006) $ - * - * Copyright (C) 2007 Egon Willighagen - * - * Contact: cdk-devel@lists.sourceforge.net - * - * 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 2.1 - * of the License, or (at your option) any later version. - * All we ask is that proper credit is given for our work, which includes - * - but is not limited to - adding the above copyright notice to the beginning - * of your source code files, and to any copyright notice that you may distribute - * with programs based on this work. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package net.sf.cdk.tools.bibtex; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import nu.xom.Node; -import nu.xom.Nodes; -import nu.xom.XPathContext; - -/** - * Wrapper for a BibTeXML file. - * - * @author egonw - */ -public class BibTeXMLFile { - - public final static String BIBTEXML_NAMESPACE = "http://bibtexml.sf.net/"; - - private Node root; - private XPathContext context; - - public BibTeXMLFile(Node root) { - this.root = root; - context = new XPathContext("bibtex", BIBTEXML_NAMESPACE); - context.addNamespace("b", BIBTEXML_NAMESPACE); - } - - /** - * Returns an Iterator<BibTeXMLEntry>. - * - * @return The BibTeXMLEntry - */ - public Iterator getEntries() { - List entries = new ArrayList(); - Nodes results = root.query("//b:entry", context); - for (int i=0; i 0) { - return new BibTeXMLEntry(results.get(0)); - } - return null; - } - -} diff --git a/src/main/net/sf/cdk/tools/doclets/CDKBugTaglet.java b/src/main/net/sf/cdk/tools/doclets/CDKBugTaglet.java deleted file mode 100644 index 5ba055b..0000000 --- a/src/main/net/sf/cdk/tools/doclets/CDKBugTaglet.java +++ /dev/null @@ -1,100 +0,0 @@ -/* $Revision: 10432 $ $Author: miguelrojasch $ $Date: 2008-03-18 10:48:13 +0100 (Tue, 18 Mar 2008) $ - * - * Copyright (C) 2004-2007 Egon Willighagen - * - * 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 2.1 - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package net.sf.cdk.tools.doclets; - -import com.sun.tools.doclets.Taglet; -import com.sun.javadoc.*; -import java.util.Map; - -/** - * Taglet that expands @cdk.bug tag into a weblink to CDK's - * SourceForge bug track system. It's typically used as: - *
- *   @cdk.bug 1095690
- * 
- */ -public class CDKBugTaglet implements Taglet { - - private static final String NAME = "cdk.bug"; - - public String getName() { - return NAME; - } - - public boolean inField() { - return false; - } - - public boolean inConstructor() { - return false; - } - - public boolean inMethod() { - return false; - } - - public boolean inOverview() { - return false; - } - - public boolean inPackage() { - return false; - } - - public boolean inType() { - return true; - } - - public boolean isInlineTag() { - return false; - } - - public static void register(Map tagletMap) { - CDKBugTaglet tag = new CDKBugTaglet(); - Taglet t = (Taglet) tagletMap.get(tag.getName()); - if (t != null) { - tagletMap.remove(tag.getName()); - } - tagletMap.put(tag.getName(), tag); - } - - public String toString(Tag tag) { - return "
This class is affected by these bug(s):
" - + expand(tag) + "
\n"; - } - - public String toString(Tag[] tags) { - if (tags.length == 0) { - return null; - } else { - StringBuffer list = new StringBuffer(); - list.append("
This class is affected by these bug(s):
"); - for (int i=0; i\n"); - return list.toString(); - } - } - - private String expand(Tag tag) { - return "" + tag.text() + ""; - } -} diff --git a/src/main/net/sf/cdk/tools/doclets/CDKCiteTaglet.java b/src/main/net/sf/cdk/tools/doclets/CDKCiteTaglet.java deleted file mode 100644 index 01223c2..0000000 --- a/src/main/net/sf/cdk/tools/doclets/CDKCiteTaglet.java +++ /dev/null @@ -1,158 +0,0 @@ -/* $Revision: 7327 $ $Author: egonw $ $Date: 2006-11-20 20:22:51 +0100 (Mon, 20 Nov 2006) $ - * - * Copyright (C) 2004-2007 Egon Willighagen - * - * 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 2.1 - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package net.sf.cdk.tools.doclets; - -import java.io.File; -import java.util.Map; -import java.util.StringTokenizer; - -import net.sf.cdk.tools.bibtex.BibTeXMLEntry; -import net.sf.cdk.tools.bibtex.BibTeXMLFile; -import nu.xom.Builder; -import nu.xom.Document; - -import com.sun.javadoc.Tag; -import com.sun.tools.doclets.Taglet; - -/** - * Taglet that expands inline cdk.cite tags into a weblink to the CDK - * bibliography webpage. Like all inline tags it's used in the JavaDoc - * text as: - *
- * This class does nothing {@cdk.cite NULL}.
- * 
- * For this code a reference is created like this: - *
- * NULL
- * 
- * - *

Citations can be singular, like {@cdk.cite BLA}, - * and multiple, like {@cdk.cite BLA,BLA2,FOO}. - */ -public class CDKCiteTaglet implements Taglet { - - private static final String NAME = "cdk.cite"; - - private static BibTeXMLFile bibtex = null; - - static { - try { - Builder parser = new Builder(); - Document doc = parser.build(new File("doc/refs/cheminf.bibx")); - bibtex = new BibTeXMLFile(doc.getRootElement()); - } catch (Exception exc) { - System.out.println("Horrible problem: " + exc.getMessage()); - exc.printStackTrace(); - } - } - - public String getName() { - return NAME; - } - - public boolean inField() { - return true; - } - - public boolean inConstructor() { - return true; - } - - public boolean inMethod() { - return true; - } - - public boolean inOverview() { - return true; - } - - public boolean inPackage() { - return true; - } - - public boolean inType() { - return true; - } - - public boolean isInlineTag() { - return true; - } - - public static void register(Map tagletMap) { - CDKCiteTaglet tag = new CDKCiteTaglet(); - Taglet t = (Taglet) tagletMap.get(tag.getName()); - if (t != null) { - tagletMap.remove(tag.getName()); - } - tagletMap.put(tag.getName(), tag); - } - - public String toString(Tag tag) { - return "[" + expandCitation(tag.text()) + "]"; - } - - public String toString(Tag[] tags) { - String result = null; - if (tags.length > 0) { - result = "["; - for (int i=0; i"; - if (citation.indexOf(separator) != -1) { - StringTokenizer tokenizer = new StringTokenizer(citation, separator); - while (tokenizer.hasMoreTokens()) { - String token = tokenizer.nextToken().trim(); - BibTeXMLEntry entry = bibtex.getEntry(token); - if (entry != null) { - result += entry.toHTML(); - } else { - result += token + " (not found in db)"; - System.out.println("CDKCiteERROR: entry not found in database: " + token); - } - if (tokenizer.hasMoreTokens()) { - result += ", "; - } - } - } else { - citation = citation.trim(); - BibTeXMLEntry entry = bibtex.getEntry(citation); - if (entry != null) { - result += entry.toHTML(); - } else { - result += citation + " (not found in db)"; - System.out.println("CDKCiteERROR: entry not found in database: " + citation); - } - } - return result; - } - -} diff --git a/src/main/net/sf/cdk/tools/doclets/CDKDictRefTaglet.java b/src/main/net/sf/cdk/tools/doclets/CDKDictRefTaglet.java deleted file mode 100644 index 2b39813..0000000 --- a/src/main/net/sf/cdk/tools/doclets/CDKDictRefTaglet.java +++ /dev/null @@ -1,134 +0,0 @@ -/* $Revision: 10432 $ $Author: miguelrojasch $ $Date: 2008-03-18 10:48:13 +0100 (Tue, 18 Mar 2008) $ - * - * Copyright (C) 2004-2007 Egon Willighagen - * - * 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 2.1 - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package net.sf.cdk.tools.doclets; - -import com.sun.tools.doclets.Taglet; -import com.sun.javadoc.*; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.Hashtable; - -/** - * Taglet that expands inline cdk.dictref tags into a weblink to the appropriate - * dictionary. For example. - *

- * @cdk.dictref blue-obelisk:graphPartitioning
- * 
- * - *

The known dictionaries are: - *

- */ -public class CDKDictRefTaglet implements Taglet { - - private static final String NAME = "cdk.dictref"; - - private static final Map dictURLs; - private static final Map dictNames; - - static { - dictURLs = new Hashtable(5); - dictNames = new Hashtable(5); - - dictURLs.put("bodf", "http://qsar.sourceforge.net/ontologies/data-features/index.xhtml"); - dictNames.put("bodf", "Blue Obelisk Data Features Dictionary"); - - dictURLs.put("blue-obelisk", "http://qsar.sourceforge.net/dicts/blue-obelisk/index.xhtml"); - dictNames.put("blue-obelisk", "Blue Obelisk Chemoinformatics Dictionary"); - - dictURLs.put("qsar-descriptors", "http://qsar.sourceforge.net/dicts/qsar-descriptors/index.xhtml"); - dictNames.put("qsar-descriptors", "QSAR.sf.net Descriptors Dictionary"); - } - - public String getName() { - return NAME; - } - - public boolean inField() { - return true; - } - - public boolean inConstructor() { - return true; - } - - public boolean inMethod() { - return true; - } - - public boolean inOverview() { - return true; - } - - public boolean inPackage() { - return true; - } - - public boolean inType() { - return true; - } - - public boolean isInlineTag() { - return false; - } - - public static void register(Map tagletMap) { - CDKDictRefTaglet tag = new CDKDictRefTaglet(); - Taglet t = (Taglet) tagletMap.get(tag.getName()); - if (t != null) { - tagletMap.remove(tag.getName()); - } - tagletMap.put(tag.getName(), tag); - } - - public String toString(Tag tag) { - String tagText = tag.text(); - String separator = ":"; - if (tagText.indexOf(separator) != -1) { - StringTokenizer tokenizer = new StringTokenizer(tagText, separator); - String dictCode = tokenizer.nextToken(); - String dictRef = tokenizer.nextToken(); - String output = "
Dictionary pointer(s):
"; - if (dictURLs.containsKey(dictCode)) { - String url = dictURLs.get(dictCode) + "#" + dictRef; - output += "" + dictRef + - " in the " + dictNames.get(dictCode) + " [" + - tagText + "]
\n"; - } else { - output += "Unknown code: " + tagText + "\n"; - } - return output; - } else { - return "
A pointer to a dictionary:
Unknown code: " + tagText + "
\n"; - } - } - - public String toString(Tag[] tags) { - if (tags.length == 0) { - return null; - } else { - return toString(tags[0]); - } - } - -} diff --git a/src/main/net/sf/cdk/tools/doclets/CDKInChITaglet.java b/src/main/net/sf/cdk/tools/doclets/CDKInChITaglet.java deleted file mode 100644 index 5f0377c..0000000 --- a/src/main/net/sf/cdk/tools/doclets/CDKInChITaglet.java +++ /dev/null @@ -1,99 +0,0 @@ -/* $Revision: 7973 $ $Author: egonw $ $Date: 2007-02-19 13:16:03 +0100 (Mon, 19 Feb 2007) $ - * - * Copyright (C) 2007 Egon Willighagen - * - * 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 2.1 - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package net.sf.cdk.tools.doclets; - -import com.sun.tools.doclets.Taglet; -import com.sun.javadoc.*; -import java.util.Map; - -/** - * Taglet that expands @cdk.inchi tag into a RDFa marked up HTML - * fragment. It's typically used as: - *
- *   @cdk.inchi InChI=1/CH4/h1H4
- * 
- */ -public class CDKInChITaglet implements Taglet { - - private static final String NAME = "cdk.inchi"; - - public String getName() { - return NAME; - } - - public boolean inField() { - return false; - } - - public boolean inConstructor() { - return false; - } - - public boolean inMethod() { - return true; - } - - public boolean inOverview() { - return false; - } - - public boolean inPackage() { - return false; - } - - public boolean inType() { - return true; - } - - public boolean isInlineTag() { - return false; - } - - public static void register(Map tagletMap) { - CDKInChITaglet tag = new CDKInChITaglet(); - Taglet t = (Taglet) tagletMap.get(tag.getName()); - if (t != null) { - tagletMap.remove(tag.getName()); - } - tagletMap.put(tag.getName(), tag); - } - - public String toString(Tag tag) { - return "
InChI:
" - + expand(tag) + "
\n"; - } - - public String toString(Tag[] tags) { - if (tags.length == 0) { - return null; - } else { - StringBuffer list = new StringBuffer(); - list.append("
InChI(s):
"); - for (int i=0; i\n"); - return list.toString(); - } - } - - private String expand(Tag tag) { - return "" + tag.text() + ""; - } -} diff --git a/src/main/net/sf/cdk/tools/doclets/CDKModuleTaglet.java b/src/main/net/sf/cdk/tools/doclets/CDKModuleTaglet.java deleted file mode 100644 index 56ab3a1..0000000 --- a/src/main/net/sf/cdk/tools/doclets/CDKModuleTaglet.java +++ /dev/null @@ -1,88 +0,0 @@ -/* $Revision: 10432 $ $Author: miguelrojasch $ $Date: 2008-03-18 10:48:13 +0100 (Tue, 18 Mar 2008) $ - * - * Copyright (C) 2004 Egon Willighagen - * - * 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 2.1 - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package net.sf.cdk.tools.doclets; - -import com.sun.tools.doclets.Taglet; -import com.sun.javadoc.*; -import java.util.Map; - -/** - * Taglet that expands @cdk.module tag into a weblink to the CDK - * webpage. - */ -public class CDKModuleTaglet implements Taglet { - - private static final String NAME = "cdk.module"; - - public String getName() { - return NAME; - } - - public boolean inField() { - return true; - } - - public boolean inConstructor() { - return true; - } - - public boolean inMethod() { - return true; - } - - public boolean inOverview() { - return true; - } - - public boolean inPackage() { - return true; - } - - public boolean inType() { - return true; - } - - public boolean isInlineTag() { - return false; - } - - public static void register(Map tagletMap) { - CDKModuleTaglet tag = new CDKModuleTaglet(); - Taglet t = (Taglet) tagletMap.get(tag.getName()); - if (t != null) { - tagletMap.remove(tag.getName()); - } - tagletMap.put(tag.getName(), tag); - } - - public String toString(Tag tag) { - return "
Belongs to CDK module:
" - + "" + tag.text() + "
\n"; - } - - public String toString(Tag[] tags) { - if (tags.length == 0) { - return null; - } else { - return toString(tags[0]); - } - } - -} diff --git a/src/main/net/sf/cdk/tools/doclets/CDKSVNTaglet.java b/src/main/net/sf/cdk/tools/doclets/CDKSVNTaglet.java deleted file mode 100644 index 34f1aa4..0000000 --- a/src/main/net/sf/cdk/tools/doclets/CDKSVNTaglet.java +++ /dev/null @@ -1,137 +0,0 @@ -/* $Revision: 7973 $ $Author: egonw $ $Date: 2007-02-19 13:16:03 +0100 (Mon, 19 Feb 2007) $ - * - * Copyright (C) 2007 Egon Willighagen - * - * 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 2.1 - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -package net.sf.cdk.tools.doclets; - -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.sun.javadoc.SourcePosition; -import com.sun.javadoc.Tag; -import com.sun.tools.doclets.Taglet; - -/** - * Taglet that expands @cdk.svnrev tag into a link to the SVN - * source tree. The syntax must be as follows: - *
- *   @cdk.svnrev $Revision: 7973 $
- * 
- * - *

The actual version number is automatically updated by the - * SVN repository. - */ -public class CDKSVNTaglet implements Taglet { - - private static final String NAME = "cdk.svnrev"; - private final static Pattern svnrevPattern = Pattern.compile("\\$Revision:\\s*(\\d*)\\s*\\$"); - private final static Pattern pathPattern = Pattern.compile(".*/(src/.*\\.java)"); - - public String getName() { - return NAME; - } - - public boolean inField() { - return false; - } - - public boolean inConstructor() { - return false; - } - - public boolean inMethod() { - return false; - } - - public boolean inOverview() { - return false; - } - - public boolean inPackage() { - return false; - } - - public boolean inType() { - return true; - } - - public boolean isInlineTag() { - return false; - } - - public static void register(Map tagletMap) { - CDKSVNTaglet tag = new CDKSVNTaglet(); - Taglet t = (Taglet) tagletMap.get(tag.getName()); - if (t != null) { - tagletMap.remove(tag.getName()); - } - tagletMap.put(tag.getName(), tag); - } - - public String toString(Tag tag) { - return "

Source code:
" - + expand(tag) + "
\n"; - } - - public String toString(Tag[] tags) { - if (tags.length == 0) { - return null; - } else { - return toString(tags[0]); - } - } - - private String expand(Tag tag) { - // get the version number - String text = tag.text(); - Matcher matcher = svnrevPattern.matcher(text); - String revision = "HEAD"; - if (matcher.matches()) { - revision = matcher.group(1); - } else { - System.out.println("Malformed @cdk.svnrev content: " + text); - return ""; - } - // create the URL - SourcePosition file = tag.position(); - String path = correctSlashes(file.file().getAbsolutePath()); - matcher = pathPattern.matcher(path); - if (matcher.matches()) { - String url = "http://cdk.svn.sourceforge.net/viewvc/cdk/trunk/cdk/" + - matcher.group(1) + "?revision=" + - revision + "&view=markup"; - return "revision " + revision + ""; - } else { - System.out.println("Could not resolve class name from: " + path); - } - return ""; - } - - private String correctSlashes(String absolutePath) { - StringBuffer buffer = new StringBuffer(); - for (int i=0; i