Top Fields Constructors Methods
io.vertx.core.impl.verticle

public Class CustomJavaFileObject

extends Object
implements JavaFileObject
Class Inheritance
All Implemented Interfaces
javax.tools.JavaFileObject, javax.tools.FileObject
Imports
javax.lang.model.element.Modifier, .NestingKind, javax.tools.JavaFileObject, java.io.IOException, .InputStream, .OutputStream, .OutputStreamWriter, .Reader, .Writer, java.net.URI

Author
Janne Hietamäki

Field Summary

Modifier and TypeField and Description
private final String
private final JavaFileObject.Kind
private final URI

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public String
public boolean
delete()

Implements javax.tools.FileObject.delete.

Deletes this file object.

public Modifier
getAccessLevel()

Implements javax.tools.JavaFileObject.getAccessLevel.

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

public CharSequence
getCharContent(boolean
ignore encoding errors if true
ignoreEncodingErrors
)

Implements javax.tools.FileObject.getCharContent.

Returns the character content of this file object, if available.

public JavaFileObject.Kind
getKind()

Implements javax.tools.JavaFileObject.getKind.

Returns the kind of this file object.

public long
getLastModified()

Implements javax.tools.FileObject.getLastModified.

Returns the time this file object was last modified.

public String
getName()

Implements javax.tools.FileObject.getName.

Returns a user-friendly name for this file object.

public NestingKind
getNestingKind()

Implements javax.tools.JavaFileObject.getNestingKind.

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

public boolean
isNameCompatible(String
a simple name of a class
simpleName
,
JavaFileObject.Kind
a kind
kind
)

Implements javax.tools.JavaFileObject.isNameCompatible.

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

public InputStream
openInputStream()

Implements javax.tools.FileObject.openInputStream.

Returns an InputStream for this file object.

public OutputStream
openOutputStream()

Implements javax.tools.FileObject.openOutputStream.

Returns an OutputStream for this file object.

public Reader
openReader(boolean
ignore encoding errors if true
ignoreEncodingErrors
)

Implements javax.tools.FileObject.openReader.

Returns a reader for this object.

public Writer
openWriter()

Implements javax.tools.FileObject.openWriter.

Returns a Writer for this file object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public URI
toUri()

Implements javax.tools.FileObject.toUri.

Returns a URI identifying this file object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

binaryNameback to summary
private final String binaryName
kindback to summary
private final JavaFileObject.Kind kind
uriback to summary
private final URI uri

Constructor Detail

CustomJavaFileObjectback to summary
protected CustomJavaFileObject(URI uri, JavaFileObject.Kind kind, String binaryName)

Method Detail

binaryNameback to summary
public String binaryName()
deleteback to summary
public boolean delete()

Implements javax.tools.FileObject.delete.

Doc from javax.tools.FileObject.delete.

Deletes this file object. In case of errors, returns false.

Returns:boolean

true if and only if this file object is successfully deleted; false otherwise

getAccessLevelback to summary
public Modifier getAccessLevel()

Implements javax.tools.JavaFileObject.getAccessLevel.

Doc from javax.tools.JavaFileObject.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

getCharContentback to summary
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException

Implements javax.tools.FileObject.getCharContent.

Doc from javax.tools.FileObject.getCharContent.

Returns the character content of this file object, if available. Any byte that cannot be decoded will be replaced by the default translation character. In addition, a diagnostic may be reported unless ignoreEncodingErrors is true.

Parameters
ignoreEncodingErrors:boolean

ignore encoding errors if true

Returns:CharSequence

a CharSequence if available; null otherwise

Exceptions
IOException:
if an I/O error occurred
getKindback to summary
public JavaFileObject.Kind getKind()

Implements javax.tools.JavaFileObject.getKind.

Doc from javax.tools.JavaFileObject.getKind.

Returns the kind of this file object.

Returns:JavaFileObject.Kind

the kind

getLastModifiedback to summary
public long getLastModified()

Implements javax.tools.FileObject.getLastModified.

Doc from javax.tools.FileObject.getLastModified.

Returns the time this file object was last modified. The time is measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Returns:long

the time this file object was last modified; or 0 if the file object does not exist, if an I/O error occurred, or if the operation is not supported

getNameback to summary
public String getName()

Implements javax.tools.FileObject.getName.

Doc from javax.tools.FileObject.getName.

Returns a user-friendly name for this file object. The exact value returned is not specified but implementations should take care to preserve names as given by the user. For example, if the user writes the filename "BobsApp\Test.java" on the command line, this method should return "BobsApp\Test.java" whereas the toUri method might return file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java.

Returns:String

a user-friendly name

getNestingKindback to summary
public NestingKind getNestingKind()

Implements javax.tools.JavaFileObject.getNestingKind.

Doc from javax.tools.JavaFileObject.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)

Implements javax.tools.JavaFileObject.isNameCompatible.

Doc from javax.tools.JavaFileObject.isNameCompatible.

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

openInputStreamback to summary
public InputStream openInputStream() throws IOException

Implements javax.tools.FileObject.openInputStream.

Doc from javax.tools.FileObject.openInputStream.

Returns an InputStream for this file object.

Returns:InputStream

an InputStream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurred
openOutputStreamback to summary
public OutputStream openOutputStream() throws IOException

Implements javax.tools.FileObject.openOutputStream.

Doc from javax.tools.FileObject.openOutputStream.

Returns an OutputStream for this file object.

Returns:OutputStream

an OutputStream

Exceptions
IOException:
if an I/O error occurred
openReaderback to summary
public Reader openReader(boolean ignoreEncodingErrors) throws IOException

Implements javax.tools.FileObject.openReader.

Doc from javax.tools.FileObject.openReader.

Returns a reader for this object. The returned reader will replace bytes that cannot be decoded with the default translation character. In addition, the reader may report a diagnostic unless ignoreEncodingErrors is true.

Parameters
ignoreEncodingErrors:boolean

ignore encoding errors if true

Returns:Reader

a Reader

Exceptions
IOException:
if an I/O error occurred
openWriterback to summary
public Writer openWriter() throws IOException

Implements javax.tools.FileObject.openWriter.

Doc from javax.tools.FileObject.openWriter.

Returns a Writer for this file object.

Returns:Writer

a Writer

Exceptions
IOException:
if an I/O error occurred
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toUriback to summary
public URI toUri()

Implements javax.tools.FileObject.toUri.

Doc from javax.tools.FileObject.toUri.

Returns a URI identifying this file object.

Returns:URI

a URI

Annotations
@Override