com.sun.tools.javac.processing
Class JavacFiler.FilerOutputFileObject

java.lang.Object
  extended by javax.tools.ForwardingFileObject<FileObject>
      extended by com.sun.tools.javac.processing.JavacFiler.FilerOutputFileObject
All Implemented Interfaces:
FileObject
Direct Known Subclasses:
JavacFiler.FilerOutputJavaFileObject
Enclosing class:
JavacFiler

private class JavacFiler.FilerOutputFileObject
extends ForwardingFileObject<FileObject>

Wrap a JavaFileObject to manage writing by the Filer.


Field Summary
private  java.lang.String name
           
private  boolean opened
           
 
Fields inherited from class javax.tools.ForwardingFileObject
fileObject
 
Constructor Summary
JavacFiler.FilerOutputFileObject(java.lang.String name, FileObject fileObject)
           
 
Method Summary
 boolean delete()
          Deletes this file object.
 java.lang.CharSequence getCharContent(boolean ignoreEncodingErrors)
          Gets the character content of this file object, if available.
 java.io.InputStream openInputStream()
          Gets an InputStream for this file object.
 java.io.OutputStream openOutputStream()
          Gets an OutputStream for this file object.
 java.io.Reader openReader(boolean ignoreEncodingErrors)
          Gets a reader for this object.
 java.io.Writer openWriter()
          Gets a Writer for this file object.
 
Methods inherited from class javax.tools.ForwardingFileObject
getLastModified, getName, toUri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opened

private boolean opened

name

private java.lang.String name
Constructor Detail

JavacFiler.FilerOutputFileObject

JavacFiler.FilerOutputFileObject(java.lang.String name,
                                 FileObject fileObject)
Method Detail

openOutputStream

public java.io.OutputStream openOutputStream()
                                      throws java.io.IOException
Description copied from interface: FileObject
Gets an OutputStream for this file object.

Specified by:
openOutputStream in interface FileObject
Overrides:
openOutputStream in class ForwardingFileObject<FileObject>
Returns:
an OutputStream
Throws:
java.io.IOException - if an I/O error occurred

openWriter

public java.io.Writer openWriter()
                          throws java.io.IOException
Description copied from interface: FileObject
Gets a Writer for this file object.

Specified by:
openWriter in interface FileObject
Overrides:
openWriter in class ForwardingFileObject<FileObject>
Returns:
a Writer
Throws:
java.io.IOException - if an I/O error occurred

openInputStream

public java.io.InputStream openInputStream()
                                    throws java.io.IOException
Description copied from interface: FileObject
Gets an InputStream for this file object.

Specified by:
openInputStream in interface FileObject
Overrides:
openInputStream in class ForwardingFileObject<FileObject>
Returns:
an InputStream
Throws:
java.io.IOException - if an I/O error occurred

openReader

public java.io.Reader openReader(boolean ignoreEncodingErrors)
                          throws java.io.IOException
Description copied from interface: FileObject
Gets 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.

Specified by:
openReader in interface FileObject
Overrides:
openReader in class ForwardingFileObject<FileObject>
Parameters:
ignoreEncodingErrors - ignore encoding errors if true
Returns:
a Reader
Throws:
java.io.IOException - if an I/O error occurred

getCharContent

public java.lang.CharSequence getCharContent(boolean ignoreEncodingErrors)
                                      throws java.io.IOException
Description copied from interface: FileObject
Gets 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.

Specified by:
getCharContent in interface FileObject
Overrides:
getCharContent in class ForwardingFileObject<FileObject>
Parameters:
ignoreEncodingErrors - ignore encoding errors if true
Returns:
a CharSequence if available; null otherwise
Throws:
java.io.IOException - if an I/O error occurred

delete

public boolean delete()
Description copied from interface: FileObject
Deletes this file object. In case of errors, returns false.

Specified by:
delete in interface FileObject
Overrides:
delete in class ForwardingFileObject<FileObject>
Returns:
true if and only if this file object is successfully deleted; false otherwise