APIdia Launch Partner
Top Description Inners Methods
javax.tools

public Interface JavaFileObject

extends FileObject
Known Direct Implementers
javax.tools.SimpleJavaFileObject, javax.tools.ForwardingJavaFileObject
Imports
javax.lang.model.element.NestingKind, .Modifier, java.util.Objects

File abstraction for tools operating on Java programming language source and class files.

Unless explicitly allowed, all methods in this interface might throw a NullPointerException if given a null argument.

Since
1.6
See Also
JavaFileManager

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
JavaFileObject.Kind

Kinds of JavaFileObjects.

Method Summary

Modifier and TypeMethod and Description
public Modifier

Returns:

the access level
getAccessLevel
()

Provides a hint about the access level of the class represented by this file object.

public JavaFileObject.Kind

Returns:

the kind
getKind
()

Returns the kind of this file object.

public NestingKind

Returns:

the nesting kind, or null if the nesting kind is not known
getNestingKind
()

Provides a hint about the nesting level of the class represented by this file object.

public boolean

Returns:

true if this file object is compatible; false otherwise
isNameCompatible
(String
a simple name of a class
simpleName
,
JavaFileObject.Kind
a kind
kind
)

Checks if this file object is compatible with the specified simple name and kind.

Inherited from javax.tools.FileObject:
deletegetCharContentgetLastModifiedgetNameopenInputStreamopenOutputStreamopenReaderopenWritertoUri

Method Detail

getAccessLevelback to summary
public Modifier getAccessLevel()

Provides a hint about the access level of the class represented by this file object. If the access level is not known or this file object does not represent a class file this method returns null.

Returns:Modifier

the access level

getKindback to summary
public JavaFileObject.Kind getKind()

Returns the kind of this file object.

Returns:JavaFileObject.Kind

the kind

getNestingKindback to summary
public NestingKind getNestingKind()

Provides a hint about the nesting level of the class represented by this file object. This method may return NestingKind#MEMBER to mean NestingKind#LOCAL or NestingKind#ANONYMOUS. If the nesting level is not known or this file object does not represent a class file this method returns null.

Returns:NestingKind

the nesting kind, or null if the nesting kind is not known

isNameCompatibleback to summary
public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind)

Checks if this file object is compatible with the specified simple name and kind. A simple name is a single identifier (not qualified) as defined in The Java Language Specification, section 6.2.

Parameters
simpleName:String

a simple name of a class

kind:JavaFileObject.Kind

a kind

Returns:boolean

true if this file object is compatible; false otherwise

javax.tools back to summary

public final Enum JavaFileObject.Kind

extends Enum<JavaFileObject.Kind>
Class Inheritance

Kinds of JavaFileObjects.

Field Summary

Modifier and TypeField and Description
public static final JavaFileObject.Kind
CLASS

Class files for the Java Virtual Machine.

public final String
extension

The extension which (by convention) is normally used for this kind of file object.

public static final JavaFileObject.Kind
HTML

HTML files.

public static final JavaFileObject.Kind
OTHER

Any other kind.

public static final JavaFileObject.Kind
SOURCE

Source files written in the Java programming language.

Constructor Summary

AccessConstructor and Description
private
Kind(String extension)

Method Summary

Modifier and TypeMethod and Description
public static JavaFileObject.Kind
public static JavaFileObject.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLASSback to summary
public static final JavaFileObject.Kind CLASS

Class files for the Java Virtual Machine. For example, regular files ending with .class.

extensionback to summary
public final String extension

The extension which (by convention) is normally used for this kind of file object. If no convention exists, the empty string ("") is used.

HTMLback to summary
public static final JavaFileObject.Kind HTML

HTML files. For example, regular files ending with .html.

OTHERback to summary
public static final JavaFileObject.Kind OTHER

Any other kind.

SOURCEback to summary
public static final JavaFileObject.Kind SOURCE

Source files written in the Java programming language. For example, regular files ending with .java.

Constructor Detail

Kindback to summary
private Kind(String extension)

Method Detail

valueOfback to summary
public static JavaFileObject.Kind valueOf(String name)
valuesback to summary
public static JavaFileObject.Kind[] values()