summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2015-11-27 08:22:17 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2015-12-22 01:59:02 +0000
commit11d1d8efc1b17eb87b4cd6aa5ae82f67cb862e96 (patch)
treebb2ab2a0c820ddcb5a8a91e76f5da0e522e662eb
parentf41a2c18c6dd259d21cf72a0e66e68c7a0c9a808 (diff)
downloadclasspath-11d1d8efc1b17eb87b4cd6aa5ae82f67cb862e96.tar.gz
Add remaining javax.lang.model.util classes for Java 7.
2015-11-26 Andrew John Hughes <gnu_andrew@member.fsf.org> * javax/lang/model/util/AbstractAnnotationValueVisitor6.java: Fix missing brace in Javadoc. * javax/lang/model/util/AbstractAnnotationValueVisitor7.java: New abstract class. (AbstractAnnotationValueVisitor7()): Implemented. * javax/lang/model/util/AbstractElementVisitor7.java, New abstract class. (AbstractElementVisitor7()): Implemented. * javax/lang/model/util/AbstractTypeVisitor6.java: Fix missing brace in Javadoc. * javax/lang/model/util/AbstractTypeVisitor7.java: New abstract class. (AbstractTypeVisitor7()): Implemented. (visitUnion(UnionType,P)): Likewise. * javax/lang/model/util/ElementKindVisitor6.java: (visitVariableAsResourceVariable(VariableElement,P)): Should call visitUnknown for version 6. * javax/lang/model/util/ElementKindVisitor7.java: New class. (ElementKindVisitor7()): Implemented. (ElementKindVisitor7(R)): Likewise. (visitVariableAsResourceVariable(VariableElement,P)): Implemented to return the result of defaultAction. * javax/lang/model/util/ElementScanner6.java: Fix missing brace in Javadoc. Add missing @return documentation. (visitVariable(VariableElement,P)): Should call visitUnknown on 6 if the element is a resource variable element. * javax/lang/model/util/ElementScanner7.java, New class. (ElementScanner7()): Implemented. (ElementScanner7(R)): Likewise. (visitVariable(VariableElement,P)): Implemented. * javax/lang/model/util/SimpleAnnotationValueVisitor7.java: New class. (SimpleAnnotationValueVisitor7()): Implemented. (SimpleAnnotationValueVisitor7(R)): Likewise. * javax/lang/model/util/SimpleElementVisitor6.java: (visitVariable(VariableElement,P)): Should call visitUnknown on 6 if the element is a resource variable element. * javax/lang/model/util/SimpleElementVisitor7.java: New class. (SimpleElementVisitor7()): Implemented. (SimpleElementVisitor7(R)): Likewise. (visitVariable(VariableElement,P)): Implemented. * javax/lang/model/util/SimpleTypeVisitor6.java: (SimpleTypeVisitor6): Fix copy-and-paste error in documentation. * javax/lang/model/util/SimpleTypeVisitor7.java: New class. (SimpleTypeVisitor7()): Implemented. (SimpleTypeVisitor7(R)): Likewise. (visitUnion(UnionType,P)): Implemented. * javax/lang/model/util/TypeKindVisitor7.java, New class. (TypeKindVisitor7()): Implemented. (TypeKindVisitor7(R)): Likewise. (visitUnion(UnionType,P)): Implemented. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
-rw-r--r--ChangeLog60
-rw-r--r--javax/lang/model/util/AbstractAnnotationValueVisitor6.java2
-rw-r--r--javax/lang/model/util/AbstractAnnotationValueVisitor7.java78
-rw-r--r--javax/lang/model/util/AbstractElementVisitor7.java78
-rw-r--r--javax/lang/model/util/AbstractTypeVisitor6.java2
-rw-r--r--javax/lang/model/util/AbstractTypeVisitor7.java90
-rw-r--r--javax/lang/model/util/ElementKindVisitor6.java6
-rw-r--r--javax/lang/model/util/ElementKindVisitor7.java117
-rw-r--r--javax/lang/model/util/ElementScanner6.java18
-rw-r--r--javax/lang/model/util/ElementScanner7.java112
-rw-r--r--javax/lang/model/util/SimpleAnnotationValueVisitor7.java94
-rw-r--r--javax/lang/model/util/SimpleElementVisitor6.java15
-rw-r--r--javax/lang/model/util/SimpleElementVisitor7.java113
-rw-r--r--javax/lang/model/util/SimpleTypeVisitor6.java2
-rw-r--r--javax/lang/model/util/SimpleTypeVisitor7.java111
-rw-r--r--javax/lang/model/util/TypeKindVisitor7.java116
16 files changed, 1001 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index e4df08d6e..b9603350c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,63 @@
+2015-11-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/lang/model/util/AbstractAnnotationValueVisitor6.java:
+ Fix missing brace in Javadoc.
+ * javax/lang/model/util/AbstractAnnotationValueVisitor7.java:
+ New abstract class.
+ (AbstractAnnotationValueVisitor7()): Implemented.
+ * javax/lang/model/util/AbstractElementVisitor7.java,
+ New abstract class.
+ (AbstractElementVisitor7()): Implemented.
+ * javax/lang/model/util/AbstractTypeVisitor6.java:
+ Fix missing brace in Javadoc.
+ * javax/lang/model/util/AbstractTypeVisitor7.java:
+ New abstract class.
+ (AbstractTypeVisitor7()): Implemented.
+ (visitUnion(UnionType,P)): Likewise.
+ * javax/lang/model/util/ElementKindVisitor6.java:
+ (visitVariableAsResourceVariable(VariableElement,P)):
+ Should call visitUnknown for version 6.
+ * javax/lang/model/util/ElementKindVisitor7.java:
+ New class.
+ (ElementKindVisitor7()): Implemented.
+ (ElementKindVisitor7(R)): Likewise.
+ (visitVariableAsResourceVariable(VariableElement,P)):
+ Implemented to return the result of defaultAction.
+ * javax/lang/model/util/ElementScanner6.java:
+ Fix missing brace in Javadoc. Add missing @return
+ documentation.
+ (visitVariable(VariableElement,P)): Should call visitUnknown
+ on 6 if the element is a resource variable element.
+ * javax/lang/model/util/ElementScanner7.java,
+ New class.
+ (ElementScanner7()): Implemented.
+ (ElementScanner7(R)): Likewise.
+ (visitVariable(VariableElement,P)): Implemented.
+ * javax/lang/model/util/SimpleAnnotationValueVisitor7.java:
+ New class.
+ (SimpleAnnotationValueVisitor7()): Implemented.
+ (SimpleAnnotationValueVisitor7(R)): Likewise.
+ * javax/lang/model/util/SimpleElementVisitor6.java:
+ (visitVariable(VariableElement,P)): Should call visitUnknown
+ on 6 if the element is a resource variable element.
+ * javax/lang/model/util/SimpleElementVisitor7.java:
+ New class.
+ (SimpleElementVisitor7()): Implemented.
+ (SimpleElementVisitor7(R)): Likewise.
+ (visitVariable(VariableElement,P)): Implemented.
+ * javax/lang/model/util/SimpleTypeVisitor6.java:
+ (SimpleTypeVisitor6): Fix copy-and-paste error in documentation.
+ * javax/lang/model/util/SimpleTypeVisitor7.java:
+ New class.
+ (SimpleTypeVisitor7()): Implemented.
+ (SimpleTypeVisitor7(R)): Likewise.
+ (visitUnion(UnionType,P)): Implemented.
+ * javax/lang/model/util/TypeKindVisitor7.java,
+ New class.
+ (TypeKindVisitor7()): Implemented.
+ (TypeKindVisitor7(R)): Likewise.
+ (visitUnion(UnionType,P)): Implemented.
+
2015-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
* javax/lang/model/type/WildcardType.java:
diff --git a/javax/lang/model/util/AbstractAnnotationValueVisitor6.java b/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
index 8f0800f5f..025e57c80 100644
--- a/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
+++ b/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
@@ -55,7 +55,7 @@ import javax.lang.model.element.UnknownAnnotationValueException;
* in order to support later language versions, methods beginning with
* the phrase {@code "visit"} should be avoided in subclasses. This
* class itself will be extended to direct these new methods to the
- * {@link #visitUnknown(AnnotationValue,P) method and a new class will be
+ * {@link #visitUnknown(AnnotationValue,P)} method and a new class will be
* added to provide implementations for the new language version.
* At this time, all or some of this class may be deprecated.</p>
*
diff --git a/javax/lang/model/util/AbstractAnnotationValueVisitor7.java b/javax/lang/model/util/AbstractAnnotationValueVisitor7.java
new file mode 100644
index 000000000..fa967883f
--- /dev/null
+++ b/javax/lang/model/util/AbstractAnnotationValueVisitor7.java
@@ -0,0 +1,78 @@
+/* AbstractAnnotationValueVisitor7.java -- A visitor of annotation values for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+/**
+ * <p>A skeletal implementation of {@link AnnotationValueVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}). Implementors can extend this
+ * class and need provide only implementations of the
+ * {@code visitXYZ} methods appropriate to 1.7.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(AnnotationValue,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public abstract class AbstractAnnotationValueVisitor7<R,P> extends AbstractAnnotationValueVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@code AbstractAnnotationValueVisitor7}.
+ */
+ protected AbstractAnnotationValueVisitor7()
+ {
+ super();
+ }
+
+}
diff --git a/javax/lang/model/util/AbstractElementVisitor7.java b/javax/lang/model/util/AbstractElementVisitor7.java
new file mode 100644
index 000000000..3214c58a1
--- /dev/null
+++ b/javax/lang/model/util/AbstractElementVisitor7.java
@@ -0,0 +1,78 @@
+/* AbstractElementVisitor7.java -- A visitor of program elements for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+/**
+ * <p>A skeletal implementation of {@link ElementVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}). Implementors can extend this
+ * class and need provide only implementations of the
+ * {@code visitXYZ} methods appropriate to 1.7.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(Element,P) method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public abstract class AbstractElementVisitor7<R,P> extends AbstractElementVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@code AbstractElementVisitor7}.
+ */
+ protected AbstractElementVisitor7()
+ {
+ super();
+ }
+
+}
diff --git a/javax/lang/model/util/AbstractTypeVisitor6.java b/javax/lang/model/util/AbstractTypeVisitor6.java
index 7d907187d..54f500888 100644
--- a/javax/lang/model/util/AbstractTypeVisitor6.java
+++ b/javax/lang/model/util/AbstractTypeVisitor6.java
@@ -54,7 +54,7 @@ import javax.lang.model.type.UnknownTypeException;
* in order to support later language versions, methods beginning with
* the phrase {@code "visit"} should be avoided in subclasses. This
* class itself will be extended to direct these new methods to the
- * {@link #visitUnknown(TypeMirror,P) method and a new class will be
+ * {@link #visitUnknown(TypeMirror,P)} method and a new class will be
* added to provide implementations for the new language version.
* At this time, all or some of this class may be deprecated.</p>
*
diff --git a/javax/lang/model/util/AbstractTypeVisitor7.java b/javax/lang/model/util/AbstractTypeVisitor7.java
new file mode 100644
index 000000000..bba1fb713
--- /dev/null
+++ b/javax/lang/model/util/AbstractTypeVisitor7.java
@@ -0,0 +1,90 @@
+/* AbstractTypeVisitor7.java -- A visitor of types for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.lang.model.SourceVersion;
+
+import javax.lang.model.type.UnionType;
+
+/**
+ * <p>A skeletal implementation of {@link TypeVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_6}). Implementors can extend this
+ * class and need provide only implementations of the
+ * {@code visitXYZ} methods appropriate to 1.7.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(TypeMirror,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods. {@code Void} can be used where no additional
+ * parameter is required.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+public abstract class AbstractTypeVisitor7<R,P> extends AbstractTypeVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@code AbstractTypeVisitor7}.
+ */
+ protected AbstractTypeVisitor7()
+ {
+ super();
+ }
+
+ /**
+ * Visits a union type in a manner defined by a concrete subclass.
+ *
+ * @param type the union type to visit.
+ * @param param the additional parameter, specific to the visitor.
+ * May be {@code null} if permitted by the visitor.
+ * @return the return value specific to the visitor.
+ * @since 1.7
+ */
+ @Override
+ public abstract R visitUnion(UnionType type, P parameter);
+
+}
diff --git a/javax/lang/model/util/ElementKindVisitor6.java b/javax/lang/model/util/ElementKindVisitor6.java
index 8e9760ac3..d9d494271 100644
--- a/javax/lang/model/util/ElementKindVisitor6.java
+++ b/javax/lang/model/util/ElementKindVisitor6.java
@@ -416,16 +416,16 @@ public class ElementKindVisitor6<R,P> extends SimpleElementVisitor6<R,P>
/**
* Visits a {@code RESOURCE_VARIABLE} variable element. This implementation
- * simply calls {@code defaultAction(element, parameter)}.
+ * calls {@code visitUnknown(element, parameter)}.
*
- * @param element the resource variable variable element to visit.
+ * @param element the resource variable element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
* @return the result of {@code defaultAction(element, parameter)}.
*/
public R visitVariableAsResourceVariable(VariableElement element, P parameter)
{
- return defaultAction(element, parameter);
+ return visitUnknown(element, parameter);
}
}
diff --git a/javax/lang/model/util/ElementKindVisitor7.java b/javax/lang/model/util/ElementKindVisitor7.java
new file mode 100644
index 000000000..52d723195
--- /dev/null
+++ b/javax/lang/model/util/ElementKindVisitor7.java
@@ -0,0 +1,117 @@
+/* ElementKindVisitor7.java -- An element visitor implementation for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+import javax.lang.model.element.VariableElement;
+
+/**
+ * <p>An implementation of {@link ElementVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}) which redirects each
+ * {@code visitXYZ} method call to a more specific
+ * {@code visitXYZAsKind} method, depending on the kind
+ * of the first argument. For example, a call to
+ * {@code visitExecutable} redirects to {@code visitExecutableAsConstructor},
+ * {@code visitExecutableAsInstanceInit},
+ * {@code visitExecutableAsMethod} or {@code visitExecutableAsStaticInit},
+ * depending on the type of executable supplied. {@code visitXYZAsKind} then
+ * redirects to {@code defaultAction(element, parameter)}.
+ * Implementors may extend this class and provide alternative
+ * implementations of {@link #defaultAction(Element, P)} and
+ * the {@code visitXYZKind} methods as appropriate.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(Element,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods. {@code Void} can be used if this is not needed.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public class ElementKindVisitor7<R,P> extends ElementKindVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@link ElementKindVisitor7} with a {@code null}
+ * default value.
+ */
+ protected ElementKindVisitor7()
+ {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@link ElementKindVisitor7} with the specified
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link SimpleElementVisitor6#DEFAULT_VALUE}.
+ */
+ protected ElementKindVisitor7(R defaultValue)
+ {
+ super(defaultValue);
+ }
+
+ /**
+ * Visits a {@code RESOURCE_VARIABLE} variable element. This implementation
+ * simply calls {@code defaultAction(element, parameter)}.
+ *
+ * @param element the resource variable element to visit.
+ * @param parameter the additional parameter, specific to the visitor.
+ * May be {@code null}.
+ * @return the result of {@code defaultAction(element, parameter)}.
+ */
+ public R visitVariableAsResourceVariable(VariableElement element, P parameter)
+ {
+ return defaultAction(element, parameter);
+ }
+
+}
+
+
diff --git a/javax/lang/model/util/ElementScanner6.java b/javax/lang/model/util/ElementScanner6.java
index ef3f0cc61..f229e55d9 100644
--- a/javax/lang/model/util/ElementScanner6.java
+++ b/javax/lang/model/util/ElementScanner6.java
@@ -1,5 +1,5 @@
/* ElementScanner6.java -- A scanning visitor of program elements for 1.6.
- Copyright (C) 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013, 2015 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,6 +42,7 @@ import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ElementVisitor;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.PackageElement;
@@ -62,7 +63,7 @@ import javax.lang.model.element.VariableElement;
* in order to support later language versions, methods beginning with
* the phrase {@code "visit"} should be avoided in subclasses. This
* class itself will be extended to direct these new methods to the
- * {@link #visitUnknown(Element,P) method and a new class will be
+ * {@link #visitUnknown(Element,P)} method and a new class will be
* added to provide implementations for the new language version.
* At this time, all or some of this class may be deprecated.</p>
*
@@ -156,6 +157,7 @@ public class ElementScanner6<R,P> extends AbstractElementVisitor6<R,P>
* @param element the executable element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
+ * @return the result of scanning the element's parameters.
*/
@Override
public R visitExecutable(ExecutableElement element, P parameter)
@@ -171,6 +173,7 @@ public class ElementScanner6<R,P> extends AbstractElementVisitor6<R,P>
* @param element the package element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
+ * @return the result of scanning the enclosed elements.
*/
@Override
public R visitPackage(PackageElement element, P parameter)
@@ -185,6 +188,7 @@ public class ElementScanner6<R,P> extends AbstractElementVisitor6<R,P>
* @param element the type element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
+ * @return the result of scanning the enclosed elements.
*/
@Override
public R visitType(TypeElement element, P parameter)
@@ -199,6 +203,7 @@ public class ElementScanner6<R,P> extends AbstractElementVisitor6<R,P>
* @param element the type parameter element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
+ * @return the result of scanning the enclosed elements.
*/
@Override
public R visitTypeParameter(TypeParameterElement element, P parameter)
@@ -208,15 +213,22 @@ public class ElementScanner6<R,P> extends AbstractElementVisitor6<R,P>
/**
* Visits a variable element. This implementation scans the
- * enclosed elements.
+ * enclosed elements, unless the element is a {@code RESOURCE_VARIABLE},
+ * in which case it calls {@code visitUnknown(element, parameter)} to
+ * retain 1.6 behaviour.
*
* @param element the variable element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
+ * @return the result of scanning the enclosed elements, or
+ * the result of {@code visitUnknown(element, parameter)} if
+ * the element is a {@code RESOURCE_VARIABLE}.
*/
@Override
public R visitVariable(VariableElement element, P parameter)
{
+ if (element.getKind() == ElementKind.RESOURCE_VARIABLE)
+ return visitUnknown(element, parameter);
return scan(element.getEnclosedElements(), parameter);
}
diff --git a/javax/lang/model/util/ElementScanner7.java b/javax/lang/model/util/ElementScanner7.java
new file mode 100644
index 000000000..004f34c5d
--- /dev/null
+++ b/javax/lang/model/util/ElementScanner7.java
@@ -0,0 +1,112 @@
+/* ElementScanner7.java -- A scanning visitor of program elements for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementVisitor;
+import javax.lang.model.element.VariableElement;
+
+/**
+ * <p>A scanning implementation of {@link ElementVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}). Each {@code visitXYZ} method
+ * calls {@link scan(Element)} on the elements enclosed within the
+ * one it receives as an argument. Implementors may extend this
+ * class and provide alternative implementations of the {@code visitXYZ}
+ * methods appropriate, so that scanning takes place in a different
+ * order.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(Element,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public class ElementScanner7<R,P> extends ElementScanner6<R,P>
+{
+
+ /**
+ * Constructs a new {@code ElementScanner7} using {@code null}
+ * as the default value.
+ */
+ protected ElementScanner7()
+ {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@code ElementScanner7} using the specified
+ * default value.
+ *
+ * @param defaultValue the default value to return when there
+ * no elements to scan.
+ */
+ protected ElementScanner7(R defaultValue)
+ {
+ super(defaultValue);
+ }
+
+ /**
+ * Visits a variable element. This implementation scans the
+ * enclosed elements.
+ *
+ * @param element the variable element to visit.
+ * @param parameter the additional parameter, specific to the visitor.
+ * May be {@code null}.
+ */
+ @Override
+ public R visitVariable(VariableElement element, P parameter)
+ {
+ return scan(element.getEnclosedElements(), parameter);
+ }
+
+}
diff --git a/javax/lang/model/util/SimpleAnnotationValueVisitor7.java b/javax/lang/model/util/SimpleAnnotationValueVisitor7.java
new file mode 100644
index 000000000..1f2485e39
--- /dev/null
+++ b/javax/lang/model/util/SimpleAnnotationValueVisitor7.java
@@ -0,0 +1,94 @@
+/* SimpleAnnotationValueVisitor7.java -- A simple visitor implementation for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+/**
+ * <p>A simple implementation of {@link AnnotationValueVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}). Each {@code visitXYZ} method
+ * redirects to {@code defaultAction(value, parameter)}.
+ * Implementors may extend this class and provide alternative
+ * implementations of {@link #defaultAction(Object, P)} and
+ * the {@code visitXYZ} methods as appropriate.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(AnnotationValue,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public class SimpleAnnotationValueVisitor7<R,P> extends SimpleAnnotationValueVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@link SimpleAnnotationValueVisitor7} with a {@code null}
+ * default value.
+ */
+ protected SimpleAnnotationValueVisitor7()
+ {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@link SimpleAnnotationValueVisitor7} with the specified
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}.
+ */
+ protected SimpleAnnotationValueVisitor7(R defaultValue)
+ {
+ super(defaultValue);
+ }
+
+}
+
+
diff --git a/javax/lang/model/util/SimpleElementVisitor6.java b/javax/lang/model/util/SimpleElementVisitor6.java
index f41315087..f0aacd34b 100644
--- a/javax/lang/model/util/SimpleElementVisitor6.java
+++ b/javax/lang/model/util/SimpleElementVisitor6.java
@@ -1,5 +1,5 @@
/* SimpleElementVisitor6.java -- A simple visitor implementation for 1.6.
- Copyright (C) 2013 Free Software Foundation, Inc.
+ Copyright (C) 2013, 2015 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,6 +42,7 @@ import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ElementVisitor;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.PackageElement;
@@ -177,17 +178,23 @@ public class SimpleElementVisitor6<R,P> extends AbstractElementVisitor6<R,P>
}
/**
- * Visits a variable element. This implementation simply
- * calls {@code defaultAction(element, parameter)}.
+ * Visits a variable element. This implementation calls
+ * {@code defaultAction(element, parameter)}, unless the element is a
+ * {@code RESOURCE_VARIABLE}, in which case it calls
+ * {@code visitUnknown(element, parameter)} to retain 1.6 behaviour.
*
* @param element the variable element to visit.
* @param parameter the additional parameter, specific to the visitor.
* May be {@code null}.
- * @return the result of {@code defaultAction(element, parameter)}.
+ * @return the result of {@code defaultAction(element, parameter)},
+ * or {@code visitUnknown(element, parameter)} if the element
+ * is a {@code RESOURCE_VARIABLE}.
*/
@Override
public R visitVariable(VariableElement element, P parameter)
{
+ if (element.getKind() == ElementKind.RESOURCE_VARIABLE)
+ return visitUnknown(element, parameter);
return defaultAction(element, parameter);
}
diff --git a/javax/lang/model/util/SimpleElementVisitor7.java b/javax/lang/model/util/SimpleElementVisitor7.java
new file mode 100644
index 000000000..b4c43a1d3
--- /dev/null
+++ b/javax/lang/model/util/SimpleElementVisitor7.java
@@ -0,0 +1,113 @@
+/* SimpleElementVisitor7.java -- A simple visitor implementation for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementVisitor;
+import javax.lang.model.element.VariableElement;
+
+/**
+ * <p>A simple implementation of {@link ElementVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}). Each {@code visitXYZ} method
+ * redirects to {@code defaultAction(element, parameter)}.
+ * Implementors may extend this class and provide alternative
+ * implementations of {@link #defaultAction(Element, P)} and
+ * the {@code visitXYZ} methods as appropriate.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(Element,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public class SimpleElementVisitor7<R,P> extends SimpleElementVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@link SimpleElementVisitor7} with a {@code null}
+ * default value.
+ */
+ protected SimpleElementVisitor7()
+ {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@link SimpleElementVisitor7} with the specified
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}.
+ */
+ protected SimpleElementVisitor7(R defaultValue)
+ {
+ super(defaultValue);
+ }
+
+ /**
+ * Visits a variable element. This implementation simply
+ * calls {@code defaultAction(element, parameter)}.
+ *
+ * @param element the variable element to visit.
+ * @param parameter the additional parameter, specific to the visitor.
+ * May be {@code null}.
+ * @return the result of {@code defaultAction(element, parameter)}.
+ */
+ @Override
+ public R visitVariable(VariableElement element, P parameter)
+ {
+ return defaultAction(element, parameter);
+ }
+
+}
+
+
diff --git a/javax/lang/model/util/SimpleTypeVisitor6.java b/javax/lang/model/util/SimpleTypeVisitor6.java
index c41c77ece..4b6e050ee 100644
--- a/javax/lang/model/util/SimpleTypeVisitor6.java
+++ b/javax/lang/model/util/SimpleTypeVisitor6.java
@@ -85,7 +85,7 @@ public class SimpleTypeVisitor6<R,P> extends AbstractTypeVisitor6<R,P>
protected final R DEFAULT_VALUE;
/**
- * Constructs a new {@link SimpleAnnotationValueVisitor6} with a {@code null}
+ * Constructs a new {@link SimpleTypeVisitor6} with a {@code null}
* default value.
*/
protected SimpleTypeVisitor6()
diff --git a/javax/lang/model/util/SimpleTypeVisitor7.java b/javax/lang/model/util/SimpleTypeVisitor7.java
new file mode 100644
index 000000000..356820c2c
--- /dev/null
+++ b/javax/lang/model/util/SimpleTypeVisitor7.java
@@ -0,0 +1,111 @@
+/* SimpleTypeVisitor7.java -- A simple visitor implementation for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+import javax.lang.model.type.UnionType;
+
+/**
+ * <p>A simple implementation of {@link TypeVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}). Each {@code visitXYZ} method
+ * redirects to {@code defaultAction(type, parameter)}.
+ * Implementors may extend this class and provide alternative
+ * implementations of {@link #defaultAction(TypeMirror, P)} and
+ * the {@code visitXYZ} methods as appropriate.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(TypeMirror,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public class SimpleTypeVisitor7<R,P> extends SimpleTypeVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@link SimpleTypeVisitor7} with a {@code null}
+ * default value.
+ */
+ protected SimpleTypeVisitor7()
+ {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@link SimpleTypeVisitor7} with the specified
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}.
+ */
+ protected SimpleTypeVisitor7(R defaultValue)
+ {
+ super(defaultValue);
+ }
+
+ /**
+ * Visits a UnionType instance. This implementation simply
+ * calls {@code defaultAction(type, parameter)}.
+ *
+ * @param type the UnionType instance to visit.
+ * @param parameter the additional parameter, specific to the visitor.
+ * May be {@code null}.
+ * @return the result of {@code defaultAction(type, parameter)}.
+ */
+ @Override
+ public R visitUnion(UnionType type, P parameter)
+ {
+ return defaultAction(type, parameter);
+ }
+
+}
+
+
diff --git a/javax/lang/model/util/TypeKindVisitor7.java b/javax/lang/model/util/TypeKindVisitor7.java
new file mode 100644
index 000000000..75d9dfd80
--- /dev/null
+++ b/javax/lang/model/util/TypeKindVisitor7.java
@@ -0,0 +1,116 @@
+/* TypeKindVisitor7.java -- A type visitor implementation for 1.7.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.lang.model.util;
+
+import javax.annotation.processing.SupportedSourceVersion;
+
+import javax.lang.model.SourceVersion;
+
+import javax.lang.model.type.UnionType;
+
+/**
+ * <p>An implementation of {@link TypeVisitor} for the
+ * 1.7 version of the Java programming language
+ * ({@link SourceVersion#RELEASE_7}) which redirects each
+ * {@code visitXYZ} method call to a more specific
+ * {@code visitXYZAsKind} method, depending on the kind
+ * of the first argument. For example, a call to
+ * {@code visitNoType} redirects to {@code visitNoTypeAsNone},
+ * {@code visitNoTypeAsPackage} or {@code visitNoTypeAsVoid},
+ * depending on the type of {@code NoType} supplied. {@code visitXYZAsKind} then
+ * redirects to {@code defaultAction(element, parameter)}.
+ * Implementors may extend this class and provide alternative
+ * implementations of {@link #defaultAction(TypeMirror, P)} and
+ * the {@code visitXYZKind} methods as appropriate.</p>
+ * <p>As the interface this class implements may be extended in future,
+ * in order to support later language versions, methods beginning with
+ * the phrase {@code "visit"} should be avoided in subclasses. This
+ * class itself will be extended to direct these new methods to the
+ * {@link #visitUnknown(TypeMirror,P)} method and a new class will be
+ * added to provide implementations for the new language version.
+ * At this time, all or some of this class may be deprecated.</p>
+ *
+ * @param <R> the return type of the visitor's methods. {@code Void}
+ * can be used where there is no return value.
+ * @param <P> the type of the additional parameter supplied to the visitor's
+ * methods. {@code Void} can be used if this is not needed.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.7
+ */
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
+public class TypeKindVisitor7<R,P> extends TypeKindVisitor6<R,P>
+{
+
+ /**
+ * Constructs a new {@link TypeKindVisitor7} with a {@code null}
+ * default value.
+ */
+ protected TypeKindVisitor7()
+ {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@link TypeKindVisitor7} with the specified
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link SimpleTypeVisitor6#DEFAULT_VALUE}.
+ */
+ protected TypeKindVisitor7(R defaultValue)
+ {
+ super(defaultValue);
+ }
+
+ /**
+ * Visits a {@code UnionType} instance. This implementation
+ * simply calls {@code defaultAction(type, parameter)}.
+ *
+ * @param type the type to visit.
+ * @param parameter the additional parameter, specific to the visitor.
+ * May be {@code null}.
+ * @return the result of {@code defaultAction(type, parameter)}.
+ */
+ public R visitUnion(UnionType type, P parameter)
+ {
+ return defaultAction(type, parameter);
+ }
+
+}
+
+