public interface JavaFileObject extends FileObject
在这个接口的所有方法可能如果发生安全异常抛出SecurityException。
除非明确允许,在这个接口的所有方法可能如果null
论点抛出一个NullPointerException。
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, toUri
JavaFileObject.Kind getKind()
boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind)
simpleName
-一类简单的名字
kind
true
文件对象是兼容的;否则为false
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.