public interface JavaFileObject extends FileObject
如果发生安全异常,此接口中的所有方法都可能会抛出SecurityException异常。
除非明确允许,如果给定了一个null参数,则该接口中的所有方法都可能会抛出NullPointerException null 。
JavaFileManager
| Modifier and Type | Interface and Description |
|---|---|
static class |
JavaFileObject.Kind
种类的JavaFileObjects。
|
| Modifier and Type | Method and Description |
|---|---|
Modifier |
getAccessLevel()
提供关于由该文件对象表示的类的访问级别的提示。
|
JavaFileObject.Kind |
getKind()
获取此文件对象的种类。
|
NestingKind |
getNestingKind()
提供关于由该文件对象表示的类的嵌套级别的提示。
|
boolean |
isNameCompatible(String simpleName, JavaFileObject.Kind kind)
检查此文件对象是否与指定的简单名称和种类兼容。
|
delete, getCharContent, getLastModified, getName, openInputStream, openOutputStream, openReader, openWriter, toUriJavaFileObject.Kind getKind()
boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind)
simpleName - 类的简单名称
kind - 一种
true如果这个文件对象是兼容的;
否则为假
NestingKind getNestingKind()
NestingKind.MEMBER ,表示NestingKind.LOCAL或NestingKind.ANONYMOUS 。
如果嵌套级别未知或此文件对象不表示类文件,则此方法返回null 。
null如果嵌套类型不知道
Modifier getAccessLevel()
null 。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.