summaryrefslogtreecommitdiff
path: root/javax/tools/JavaFileObject.java
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2012-12-28 18:16:18 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2012-12-28 18:16:18 +0000
commit2190710f0c2ddaa65e55ba4e31bcd200bcc56d64 (patch)
treee4b432ca2cec50ba1048b2b9557883b3c3b3f1d7 /javax/tools/JavaFileObject.java
parent621cce7fdf0e325d8789dec762e448844ba0feae (diff)
downloadclasspath-2190710f0c2ddaa65e55ba4e31bcd200bcc56d64.tar.gz
Add missing Modifier and NestingKind enumerations and associated methods.
2012-12-27 Andrew John Hughes <gnu_andrew@member.fsf.org> * javax/lang/model/element/Element.java: (getModifiers()): Added. (getSimpleName()): Likewise. * javax/lang/model/element/Modifier.java: New enumeration. (ABSTRACT): Added. (FINAL): Likewise. (NATIVE): Likewise. (PRIVATE): Likewise. (PROTECTED): Likewise. (PUBLIC): Likewise. (STATIC): Likewise. (STRICTFP): Likewise. (SYNCHRONIZED): Likewise. (TRANSIENT): Likewise. (VOLATILE): Likewise. * javax/lang/model/element/NestingKind.java: New enumeration. (ANONYMOUS): Added. (LOCAL): Likewise. (MEMBER): Likewise. (TOP_LEVEL): Likewise. (isNested()): Implemented. * javax/lang/model/element/TypeElement.java: (getNestingKind()): Added. * javax/tools/ForwardingJavaFileObject.java: (getAccessLevel()): Implemented. (getNestingKind()): Likewise. * javax/tools/JavaFileObject.java: (getAccessLevel()): Added. (getNestingKind()): Likewise. * javax/tools/SimpleJavaFileObject.java, (getAccessLevel()): Implemented. (getNestingKind()): Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
Diffstat (limited to 'javax/tools/JavaFileObject.java')
-rw-r--r--javax/tools/JavaFileObject.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/javax/tools/JavaFileObject.java b/javax/tools/JavaFileObject.java
index 09bd3417d..e8293316a 100644
--- a/javax/tools/JavaFileObject.java
+++ b/javax/tools/JavaFileObject.java
@@ -37,6 +37,9 @@ exception statement from your version. */
package javax.tools;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.NestingKind;
+
/**
* Abstraction for tools working with source and class files.
* All methods may throw a {@link SecurityException}. All
@@ -96,4 +99,27 @@ public interface JavaFileObject
*/
boolean isNameCompatible(String simpleName, Kind kind);
+ /**
+ * Provides a hint about the access level of this class, based
+ * on its modifiers. If the access level is unknown, or this
+ * file object does not represent a class file, {@code null}
+ * is returned.
+ *
+ * @return the access level.
+ */
+ Modifier getAccessLevel();
+
+ /**
+ * Provides a hint about the nesting level of this class.
+ * It may return {@link NestingKind#MEMBER} instead of
+ * {@link NestingKind#LOCAL} or {@link NestingKind#ANONYMOUS}
+ * if it can not determine the exact type of nesting. If
+ * the nesting level is completely unknown, or this file
+ * object does not represent a class file, {@code null}
+ * is returned.
+ *
+ * @return the nesting level.
+ */
+ NestingKind getNestingKind();
+
}