Package org.codehaus.groovy.tools.javac
Class RawJavaFileObject
java.lang.Object
javax.tools.SimpleJavaFileObject
org.codehaus.groovy.tools.javac.RawJavaFileObject
- All Implemented Interfaces:
FileObject,JavaFileObject
Represents a Java source file in file to compile
- Since:
- 3.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind -
Field Summary
Fields inherited from class javax.tools.SimpleJavaFileObject
kind, uri -
Constructor Summary
ConstructorsConstructorDescriptionRawJavaFileObject(URI uri) Construct a RawJavaFileObject of the given kind and with the given URI. -
Method Summary
Modifier and TypeMethodDescriptionbooleandelete()delete the Java source filebooleanCompares this file object by URI.getCharContent(boolean ignoreEncodingErrors) Returns the source content of the underlying file, caching it after the first read.inthashCode()Returns the hash code derived from the URI.toString()Returns a diagnostic string for this file-backed Java file object.Methods inherited from class javax.tools.SimpleJavaFileObject
getAccessLevel, getKind, getLastModified, getName, getNestingKind, isNameCompatible, openInputStream, openOutputStream, openReader, openWriter, toUri
-
Constructor Details
-
RawJavaFileObject
Construct a RawJavaFileObject of the given kind and with the given URI.- Parameters:
uri- the URI for this file object
-
-
Method Details
-
getCharContent
Returns the source content of the underlying file, caching it after the first read.- Specified by:
getCharContentin interfaceFileObject- Overrides:
getCharContentin classSimpleJavaFileObject- Parameters:
ignoreEncodingErrors- ignored because the file is read using the configured default charset- Returns:
- the source content
- Throws:
IOException- if the file cannot be read
-
delete
public boolean delete()delete the Java source file- Specified by:
deletein interfaceFileObject- Overrides:
deletein classSimpleJavaFileObject- Returns:
trueif deleted successfully
-
equals
Compares this file object by URI. -
hashCode
public int hashCode()Returns the hash code derived from the URI. -
toString
Returns a diagnostic string for this file-backed Java file object.- Overrides:
toStringin classSimpleJavaFileObject- Returns:
- a string representation of this file object
-