org.eclipse.jdt.internal.compiler.apt.dispatch
Class HookedJavaFileObject

java.lang.Object
  extended by javax.tools.ForwardingFileObject<F>
      extended by javax.tools.ForwardingJavaFileObject<JavaFileObject>
          extended by org.eclipse.jdt.internal.compiler.apt.dispatch.HookedJavaFileObject
All Implemented Interfaces:
FileObject, JavaFileObject

public class HookedJavaFileObject
extends ForwardingJavaFileObject<JavaFileObject>

A delegating JavaFileObject that hooks the close() methods of the Writer or OutputStream objects that it produces, and notifies the annotation dispatch manager when a new compilation unit is produced.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind
 
Field Summary
protected  String _fileName
          The name of the file that is created; this is passed to the CompilationUnit constructor, and ultimately to the java.io.File constructor, so it is a normal pathname, just like what would be on the compiler command line.
protected  BatchFilerImpl _filer
          The Filer implementation that we need to notify when a new file is created.
 
Fields inherited from class javax.tools.ForwardingFileObject
fileObject
 
Constructor Summary
HookedJavaFileObject(JavaFileObject fileObject, String fileName, BatchFilerImpl filer)
           
 
Method Summary
protected  void closed()
           
 OutputStream openOutputStream()
           
 Writer openWriter()
           
 
Methods inherited from class javax.tools.ForwardingJavaFileObject
getAccessLevel, getKind, getNestingKind, isNameCompatible
 
Methods inherited from class javax.tools.ForwardingFileObject
delete, getCharContent, getLastModified, getName, openInputStream, openReader, toUri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.tools.FileObject
delete, getCharContent, getLastModified, getName, openInputStream, openReader, toUri
 

Field Detail

_filer

protected final BatchFilerImpl _filer
The Filer implementation that we need to notify when a new file is created.


_fileName

protected final String _fileName
The name of the file that is created; this is passed to the CompilationUnit constructor, and ultimately to the java.io.File constructor, so it is a normal pathname, just like what would be on the compiler command line.

Constructor Detail

HookedJavaFileObject

public HookedJavaFileObject(JavaFileObject fileObject,
                            String fileName,
                            BatchFilerImpl filer)
Method Detail

openOutputStream

public OutputStream openOutputStream()
                              throws IOException
Specified by:
openOutputStream in interface FileObject
Overrides:
openOutputStream in class ForwardingFileObject<JavaFileObject>
Throws:
IOException

openWriter

public Writer openWriter()
                  throws IOException
Specified by:
openWriter in interface FileObject
Overrides:
openWriter in class ForwardingFileObject<JavaFileObject>
Throws:
IOException

closed

protected void closed()


Copyright © 2012. All Rights Reserved.