test/tools/javac/lib/JavacTestingAbstractProcessor.java

changeset 1054
111bbf1ad913
parent 932
edf03ca74991
child 2525
2eb010b6cb22
     1.1 --- a/test/tools/javac/lib/JavacTestingAbstractProcessor.java	Fri Jul 01 14:28:19 2011 -0700
     1.2 +++ b/test/tools/javac/lib/JavacTestingAbstractProcessor.java	Tue Jul 05 16:37:24 2011 -0700
     1.3 @@ -25,6 +25,7 @@
     1.4  import javax.annotation.processing.*;
     1.5  import javax.lang.model.SourceVersion;
     1.6  import javax.lang.model.util.*;
     1.7 +import static javax.lang.model.SourceVersion.*;
     1.8  
     1.9  /**
    1.10   * An abstract annotation processor tailored to javac regression testing.
    1.11 @@ -95,4 +96,164 @@
    1.12          messager  = processingEnv.getMessager();
    1.13          options   = processingEnv.getOptions();
    1.14      }
    1.15 +
    1.16 +    /*
    1.17 +     * The set of visitors below will directly extend the most recent
    1.18 +     * corresponding platform visitor type.
    1.19 +     */
    1.20 +
    1.21 +    @SupportedSourceVersion(RELEASE_8)
    1.22 +    public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor8<R, P> {
    1.23 +
    1.24 +        /**
    1.25 +         * Constructor for concrete subclasses to call.
    1.26 +         */
    1.27 +        protected AbstractAnnotationValueVisitor() {
    1.28 +            super();
    1.29 +        }
    1.30 +    }
    1.31 +
    1.32 +    @SupportedSourceVersion(RELEASE_8)
    1.33 +    public static abstract class AbstractElementVisitor<R, P> extends AbstractElementVisitor8<R, P> {
    1.34 +        /**
    1.35 +         * Constructor for concrete subclasses to call.
    1.36 +         */
    1.37 +        protected AbstractElementVisitor(){
    1.38 +            super();
    1.39 +        }
    1.40 +    }
    1.41 +
    1.42 +    @SupportedSourceVersion(RELEASE_8)
    1.43 +    public static abstract class AbstractTypeVisitor<R, P> extends AbstractTypeVisitor8<R, P> {
    1.44 +        /**
    1.45 +         * Constructor for concrete subclasses to call.
    1.46 +         */
    1.47 +        protected AbstractTypeVisitor() {
    1.48 +            super();
    1.49 +        }
    1.50 +    }
    1.51 +
    1.52 +    @SupportedSourceVersion(RELEASE_8)
    1.53 +    public static class ElementKindVisitor<R, P> extends ElementKindVisitor8<R, P> {
    1.54 +        /**
    1.55 +         * Constructor for concrete subclasses; uses {@code null} for the
    1.56 +         * default value.
    1.57 +         */
    1.58 +        protected ElementKindVisitor() {
    1.59 +            super(null);
    1.60 +        }
    1.61 +
    1.62 +        /**
    1.63 +         * Constructor for concrete subclasses; uses the argument for the
    1.64 +         * default value.
    1.65 +         *
    1.66 +         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
    1.67 +         */
    1.68 +        protected ElementKindVisitor(R defaultValue) {
    1.69 +            super(defaultValue);
    1.70 +        }
    1.71 +    }
    1.72 +
    1.73 +    @SupportedSourceVersion(RELEASE_8)
    1.74 +    public static class ElementScanner<R, P> extends ElementScanner8<R, P> {
    1.75 +        /**
    1.76 +         * Constructor for concrete subclasses; uses {@code null} for the
    1.77 +         * default value.
    1.78 +         */
    1.79 +        protected ElementScanner(){
    1.80 +            super(null);
    1.81 +        }
    1.82 +
    1.83 +        /**
    1.84 +         * Constructor for concrete subclasses; uses the argument for the
    1.85 +         * default value.
    1.86 +         */
    1.87 +        protected ElementScanner(R defaultValue){
    1.88 +            super(defaultValue);
    1.89 +        }
    1.90 +    }
    1.91 +
    1.92 +    @SupportedSourceVersion(RELEASE_8)
    1.93 +    public static class SimpleAnnotationValueVisitor<R, P> extends SimpleAnnotationValueVisitor8<R, P> {
    1.94 +        /**
    1.95 +         * Constructor for concrete subclasses; uses {@code null} for the
    1.96 +         * default value.
    1.97 +         */
    1.98 +        protected SimpleAnnotationValueVisitor() {
    1.99 +            super(null);
   1.100 +        }
   1.101 +
   1.102 +        /**
   1.103 +         * Constructor for concrete subclasses; uses the argument for the
   1.104 +         * default value.
   1.105 +         *
   1.106 +         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
   1.107 +         */
   1.108 +        protected SimpleAnnotationValueVisitor(R defaultValue) {
   1.109 +            super(defaultValue);
   1.110 +        }
   1.111 +    }
   1.112 +
   1.113 +    @SupportedSourceVersion(RELEASE_8)
   1.114 +    public static class SimpleElementVisitor<R, P> extends SimpleElementVisitor8<R, P> {
   1.115 +        /**
   1.116 +         * Constructor for concrete subclasses; uses {@code null} for the
   1.117 +         * default value.
   1.118 +         */
   1.119 +        protected SimpleElementVisitor(){
   1.120 +            super(null);
   1.121 +        }
   1.122 +
   1.123 +        /**
   1.124 +         * Constructor for concrete subclasses; uses the argument for the
   1.125 +         * default value.
   1.126 +         *
   1.127 +         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
   1.128 +         */
   1.129 +        protected SimpleElementVisitor(R defaultValue){
   1.130 +            super(defaultValue);
   1.131 +        }
   1.132 +    }
   1.133 +
   1.134 +    @SupportedSourceVersion(RELEASE_8)
   1.135 +    public static class SimpleTypeVisitor<R, P> extends SimpleTypeVisitor8<R, P> {
   1.136 +        /**
   1.137 +         * Constructor for concrete subclasses; uses {@code null} for the
   1.138 +         * default value.
   1.139 +         */
   1.140 +        protected SimpleTypeVisitor(){
   1.141 +            super(null);
   1.142 +        }
   1.143 +
   1.144 +        /**
   1.145 +         * Constructor for concrete subclasses; uses the argument for the
   1.146 +         * default value.
   1.147 +         *
   1.148 +         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
   1.149 +         */
   1.150 +        protected SimpleTypeVisitor(R defaultValue){
   1.151 +            super(defaultValue);
   1.152 +        }
   1.153 +    }
   1.154 +
   1.155 +    @SupportedSourceVersion(RELEASE_8)
   1.156 +    public static class TypeKindVisitor<R, P> extends TypeKindVisitor8<R, P> {
   1.157 +        /**
   1.158 +         * Constructor for concrete subclasses to call; uses {@code null}
   1.159 +         * for the default value.
   1.160 +         */
   1.161 +        protected TypeKindVisitor() {
   1.162 +            super(null);
   1.163 +        }
   1.164 +
   1.165 +        /**
   1.166 +         * Constructor for concrete subclasses to call; uses the argument
   1.167 +         * for the default value.
   1.168 +         *
   1.169 +         * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
   1.170 +         */
   1.171 +        protected TypeKindVisitor(R defaultValue) {
   1.172 +            super(defaultValue);
   1.173 +        }
   1.174 +    }
   1.175  }

mercurial