JspC
Runs the JSP compiler. It can be used to precompile JSP pages
for fast initial invocation of JSP pages, deployment on a server without
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/main/org/apache/tools/ant/taskdefs/Apt.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Apt.java b/src/main/org/apache/tools/ant/taskdefs/Apt.java
deleted file mode 100644
index 52154a8..0000000
--- a/src/main/org/apache/tools/ant/taskdefs/Apt.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tools.ant.taskdefs;
-
-import java.io.File;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.compilers.AptExternalCompilerAdapter;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Reference;
-import org.apache.tools.ant.util.JavaEnvUtils;
-
-/**
- * Apt Task for running the Annotation processing tool for JDK 1.5. It derives
- * from the existing Javac task, and forces the compiler based on whether we're
- * executing internally, or externally.
- *
- * @since Ant 1.7
- */
-
-
-public class Apt
- extends Javac {
- private boolean compile = true;
- private String factory;
- private Path factoryPath;
- private Vector options = new Vector ();
- private File preprocessDir;
- /** The name of the apt tool. */
- public static final String EXECUTABLE_NAME = "apt";
- /** An warning message when ignoring compiler attribute. */
- public static final String ERROR_IGNORING_COMPILER_OPTION
- = "Ignoring compiler attribute for the APT task, as it is fixed";
- /** A warning message if used with java < 1.5. */
- public static final String ERROR_WRONG_JAVA_VERSION
- = "Apt task requires Java 1.5+";
-
- /**
- * exposed for debug messages
- */
- public static final String WARNING_IGNORING_FORK =
- "Apt only runs in its own JVM; fork=false option ignored";
-
- /**
- * The nested option element.
- */
- public static final class Option {
- private String name;
- private String value;
-
- /** Constructor for Option */
- public Option() {
- //default
- }
-
- /**
- * Get the name attribute.
- * @return the name attribute.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set the name attribute.
- * @param name the name of the option.
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Get the value attribute.
- * @return the value attribute.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Set the value attribute.
- * @param value the value of the option.
- */
- public void setValue(String value) {
- this.value = value;
- }
- }
-
- /**
- * Constructor for Apt task.
- * This sets the apt compiler adapter as the compiler in the super class.
- */
- public Apt() {
- super();
- super.setCompiler(AptExternalCompilerAdapter.class.getName());
- super.setFork(true);
- }
-
- /**
- * Get the name of the apt executable.
- *
- * @return the name of the executable.
- */
- public String getAptExecutable() {
- String exe = getExecutable();
- return exe != null ? exe :
- JavaEnvUtils.getJdkExecutable(EXECUTABLE_NAME);
- }
-
- /**
- * Set the compiler.
- * This is not allowed and a warning log message is made.
- * @param compiler not used.
- */
- public void setCompiler(String compiler) {
- log(ERROR_IGNORING_COMPILER_OPTION, Project.MSG_WARN);
- }
-
- /**
- * Set the fork attribute.
- * Non-forking APT is highly classpath dependent and appears to be too
- * brittle to work. The sole reason this attribute is retained
- * is the superclass does it
- * @param fork if false; warn the option is ignored.
- */
- public void setFork(boolean fork) {
- if (!fork) {
- log(WARNING_IGNORING_FORK, Project.MSG_WARN);
- }
- }
-
- /**
- * Get the compiler class name.
- * @return the compiler class name.
- */
- public String getCompiler() {
- return super.getCompiler();
- }
-
- /**
- * Get the compile option for the apt compiler.
- * If this is false the "-nocompile" argument will be used.
- * @return the value of the compile option.
- */
- public boolean isCompile() {
- return compile;
- }
-
- /**
- * Set the compile option for the apt compiler.
- * Default value is true.
- * @param compile if true set the compile option.
- */
- public void setCompile(boolean compile) {
- this.compile = compile;
- }
-
- /**
- * Get the factory option for the apt compiler.
- * If this is non-null the "-factory" argument will be used.
- * @return the value of the factory option.
- */
- public String getFactory() {
- return factory;
- }
-
- /**
- * Set the factory option for the apt compiler.
- * Default value is null.
- * @param factory the classname of the factory.
- */
- public void setFactory(String factory) {
- this.factory = factory;
- }
-
- /**
- * Add a reference to a path to the factoryPath attribute.
- * @param ref a reference to a path.
- */
- public void setFactoryPathRef(Reference ref) {
- createFactoryPath().setRefid(ref);
- }
-
- /**
- * Add a path to the factoryPath attribute.
- * @return a path to be configured.
- */
- public Path createFactoryPath() {
- if (factoryPath == null) {
- factoryPath = new Path(getProject());
- }
- return factoryPath.createPath();
- }
-
- /**
- * Get the factory path attribute.
- * If this is not null, the "-factorypath" argument will be used.
- * The default value is null.
- * @return the factory path attribute.
- */
- public Path getFactoryPath() {
- return factoryPath;
- }
-
- /**
- * Create a nested option.
- * @return an option to be configured.
- */
- public Option createOption() {
- Option opt = new Option();
- options.add(opt);
- return opt;
- }
-
- /**
- * Get the options to the compiler.
- * Each option will use '"-E" name ["=" value]' argument.
- * @return the options.
- */
- public Vector getOptions() {
- return options;
- }
-
- /**
- * Get the preprocessdir attribute.
- * This corresponds to the "-s" argument.
- * The default value is null.
- * @return the preprocessdir attribute.
- */
- public File getPreprocessDir() {
- return preprocessDir;
- }
-
- /**
- * Set the preprocessdir attribute.
- * @param preprocessDir where to place processor generated source files.
- */
- public void setPreprocessDir(File preprocessDir) {
- this.preprocessDir = preprocessDir;
- }
-
- /**
- * Do the compilation.
- * @throws BuildException on error.
- */
- public void execute()
- throws BuildException {
- if (JavaEnvUtils.getJavaVersionNumber() >= 18) {
- throw new BuildException("apt does not exist under Java 1.8 and higher");
- }
- super.execute();
- }
-}
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/main/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java
deleted file mode 100644
index 9503ac0..0000000
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.tools.ant.taskdefs.compilers;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Apt;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.Path;
-
-
-/**
- * The implementation of the apt compiler for JDK 1.5.
- *
- * As usual, the low level entry points for Java tools are neither documented or
- * stable; this entry point may change from that of 1.5.0_01-b08 without any
- * warning at all. The IDE decompile of the tool entry points is as follows:
- *
- * public class Main {
- * public Main() ;
- *
- * public static transient void main(String... strings);
- *
- * public static transient int process(String... strings);
- *
- * public static transient int process(PrintWriter printWriter,
- * String... strings);
- * public static transient int process(
- * AnnotationProcessorFactory annotationProcessorFactory,
- * String... strings);
- *
- * public static transient int process(
- * AnnotationProcessorFactory annotationProcessorFactory,
- * PrintWriter printWriter,
- * String... strings);
- * private static transient int processing(
- * AnnotationProcessorFactory annotationProcessorFactory,
- * PrintWriter printWriter,
- * String... strings) ;
- * }
- *
- *
- * This Adapter is designed to run Apt in-JVM, an option that is not actually
- * exposed to end-users, because it was too brittle during beta testing; classpath
- * problems being the core issue.
- *
- * @since Ant 1.7
- */
-public class AptCompilerAdapter extends DefaultCompilerAdapter {
-
- /**
- * Integer returned by the Apt compiler to indicate success.
- */
- private static final int APT_COMPILER_SUCCESS = 0;
- /**
- * class in tools.jar that implements APT
- */
- public static final String APT_ENTRY_POINT = "com.sun.tools.apt.Main";
-
- /**
- * method used to compile.
- */
- public static final String APT_METHOD_NAME = "process";
-
- /**
- * Get the facade task that fronts this adapter
- *
- * @return task instance
- * @see DefaultCompilerAdapter#getJavac()
- */
- protected Apt getApt() {
- return (Apt) getJavac();
- }
-
- /**
- * Using the front end arguments, set up the command line to run Apt
- *
- * @param apt task
- * @param cmd command that is set up with the various switches from the task
- * options
- */
- static void setAptCommandlineSwitches(final Apt apt, final Commandline cmd) {
-
- if (!apt.isCompile()) {
- cmd.createArgument().setValue("-nocompile");
- }
-
- // Process the factory class
- final String factory = apt.getFactory();
- if (factory != null) {
- cmd.createArgument().setValue("-factory");
- cmd.createArgument().setValue(factory);
- }
-
- // Process the factory path
- final Path factoryPath = apt.getFactoryPath();
- if (factoryPath != null) {
- cmd.createArgument().setValue("-factorypath");
- cmd.createArgument().setPath(factoryPath);
- }
-
- final File preprocessDir = apt.getPreprocessDir();
- if (preprocessDir != null) {
- cmd.createArgument().setValue("-s");
- cmd.createArgument().setFile(preprocessDir);
- }
-
- // Process the processor options
- final Vector options = apt.getOptions();
- final Enumeration elements = options.elements();
- Apt.Option opt;
- StringBuffer arg = null;
- while (elements.hasMoreElements()) {
- opt = (Apt.Option) elements.nextElement();
- arg = new StringBuffer();
- arg.append("-A").append(opt.getName());
- if (opt.getValue() != null) {
- arg.append("=").append(opt.getValue());
- }
- cmd.createArgument().setValue(arg.toString());
- }
- }
-
- /**
- * using our front end task, set up the command line switches
- *
- * @param cmd command line to set up
- */
- protected void setAptCommandlineSwitches(final Commandline cmd) {
- final Apt apt = getApt();
- setAptCommandlineSwitches(apt, cmd);
- }
-
- /**
- * Run the compilation.
- * @return true on success.
- * @throws BuildException if the compilation has problems.
- */
- public boolean execute() throws BuildException {
- attributes.log("Using apt compiler", Project.MSG_VERBOSE);
- //set up the javac options
- final Commandline cmd = setupModernJavacCommand();
- //then add the Apt options
- setAptCommandlineSwitches(cmd);
-
- //finally invoke APT
- // Use reflection to be able to build on all JDKs:
- try {
- final Class c = Class.forName(APT_ENTRY_POINT);
- final Object compiler = c.newInstance();
- final Method compile = c.getMethod(APT_METHOD_NAME,
- new Class[]{(new String[]{}).getClass()});
- final int result = ((Integer) compile.invoke
- (compiler, new Object[]{cmd.getArguments()}))
- .intValue();
- return (result == APT_COMPILER_SUCCESS);
- } catch (final BuildException be) {
- //rethrow build exceptions
- throw be;
- } catch (final Exception ex) {
- //cast everything else to a build exception
- throw new BuildException("Error starting apt compiler",
- ex, location);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/main/org/apache/tools/ant/taskdefs/compilers/AptExternalCompilerAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/AptExternalCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/compilers/AptExternalCompilerAdapter.java
deleted file mode 100644
index dadb55b..0000000
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/AptExternalCompilerAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.tools.ant.taskdefs.compilers;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Apt;
-import org.apache.tools.ant.types.Commandline;
-
-/**
- * The implementation of the apt compiler for JDK 1.5 using an external process
- *
- * @since Ant 1.7
- */
-public class AptExternalCompilerAdapter extends DefaultCompilerAdapter {
-
-
- /**
- * Get the facade task that fronts this adapter
- *
- * @return task instance
- * @see DefaultCompilerAdapter#getJavac()
- */
- protected Apt getApt() {
- return (Apt) getJavac();
- }
-
- /**
- * Performs a compile using the Javac externally.
- * @return true the compilation was successful.
- * @throws BuildException if there is a problem.
- */
- public boolean execute() throws BuildException {
- attributes.log("Using external apt compiler", Project.MSG_VERBOSE);
-
-
- // Setup the apt executable
- Apt apt = getApt();
- Commandline cmd = new Commandline();
- cmd.setExecutable(apt.getAptExecutable());
- setupModernJavacCommandlineSwitches(cmd);
- AptCompilerAdapter.setAptCommandlineSwitches(apt, cmd);
- int firstFileName = cmd.size();
- //add the files
- logAndAddFilesToCompile(cmd);
-
- //run
- return 0 == executeExternalCompile(cmd.getCommandline(),
- firstFileName,
- true);
-
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/main/org/apache/tools/ant/taskdefs/defaults.properties
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/defaults.properties b/src/main/org/apache/tools/ant/taskdefs/defaults.properties
index 9cf1499..e1022fb 100644
--- a/src/main/org/apache/tools/ant/taskdefs/defaults.properties
+++ b/src/main/org/apache/tools/ant/taskdefs/defaults.properties
@@ -19,7 +19,6 @@ antcall=org.apache.tools.ant.taskdefs.CallTarget
antstructure=org.apache.tools.ant.taskdefs.AntStructure
antversion=org.apache.tools.ant.taskdefs.condition.AntVersion
apply=org.apache.tools.ant.taskdefs.Transform
-apt=org.apache.tools.ant.taskdefs.Apt
attributenamespacedef=org.apache.tools.ant.taskdefs.AttributeNamespaceDef
augment=org.apache.tools.ant.taskdefs.AugmentReference
available=org.apache.tools.ant.taskdefs.Available
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/tests/antunit/taskdefs/apt/AptExample.java
----------------------------------------------------------------------
diff --git a/src/tests/antunit/taskdefs/apt/AptExample.java b/src/tests/antunit/taskdefs/apt/AptExample.java
deleted file mode 100644
index 9d6fcba..0000000
--- a/src/tests/antunit/taskdefs/apt/AptExample.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-/**
- */
-@Distributed(
- protocol="CORBA",
- distribution=Distributed.DistributionTypes.FEDERATED
- )
-public class AptExample {
-}
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/tests/antunit/taskdefs/apt/Distributed.java
----------------------------------------------------------------------
diff --git a/src/tests/antunit/taskdefs/apt/Distributed.java b/src/tests/antunit/taskdefs/apt/Distributed.java
deleted file mode 100644
index ebc3467..0000000
--- a/src/tests/antunit/taskdefs/apt/Distributed.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- */
-@Documented
-@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = ElementType.TYPE)
-public @interface Distributed {
-
- public DistributionTypes distribution() default DistributionTypes.LOCAL;
-
- public String protocol() default "RMI";
-
- public enum DistributionTypes { SINGLETON, LOCAL, FAULT_TOLERANT, FEDERATED, MOBILE};
-
-
-}
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java
----------------------------------------------------------------------
diff --git a/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java b/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java
deleted file mode 100644
index a8fb633..0000000
--- a/src/tests/antunit/taskdefs/apt/DistributedAnnotationFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-
-import java.util.Collection;
-import java.util.Set;
-import java.util.Arrays;
-import java.util.Collections;
-
-
-/**
- * This was the first piece of Java1.5 code in the source tree.
- * @since 20050-03-09T21:29:25Z
- */
-public class DistributedAnnotationFactory implements AnnotationProcessorFactory {
-
- private static final Collection supportedAnnotations
- = Collections.unmodifiableCollection(Arrays.asList("*"));
-
- public Collection supportedOptions() {
- return Collections.emptySet();
- }
-
- public Collection supportedAnnotationTypes() {
- return supportedAnnotations;
- }
-
- public AnnotationProcessor getProcessorFor(
- Set annotationTypeDeclarations,
- AnnotationProcessorEnvironment env) {
- return new DistributedAnnotationProcessor(env);
- }
-}
http://git-wip-us.apache.org/repos/asf/ant/blob/afdf355c/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java b/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java
deleted file mode 100644
index f94ff7f..0000000
--- a/src/tests/antunit/taskdefs/apt/DistributedAnnotationProcessor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-//found in tools.jar, not the JRE runtime.
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.declaration.ClassDeclaration;
-import com.sun.mirror.util.SimpleDeclarationVisitor;
-import static com.sun.mirror.util.DeclarationVisitors.*;
-
-import java.util.Map;
-
-/**
- * Annotation processor outputs stuff
- */
-
-public class DistributedAnnotationProcessor implements AnnotationProcessor {
-
- public AnnotationProcessorEnvironment env;
-
- public DistributedAnnotationProcessor(AnnotationProcessorEnvironment env) {
- this.env = env;
- }
-
- public void echo(String text) {
- env.getMessager().printNotice(text);
- }
-
- public void process() {
- echo("DistributedAnnotationProcessor-is-go");
-
- Map options=env.getOptions();
- for(String key:options.keySet()) {
- echo("Option ["+key+"] = "+options.get(key));
- }
-
- //work time
- for (TypeDeclaration typeDecl : env.getSpecifiedTypeDeclarations()) {
- typeDecl.accept(getDeclarationScanner(new ClassVisitor(),
- NO_OP));
- }
- }
-
- private class ClassVisitor extends SimpleDeclarationVisitor {
- public void visitClassDeclaration(ClassDeclaration d) {
- echo("visiting "+ d.getQualifiedName());
- }
- }
-}