1 11 package org.eclipse.jdt.apt.core.internal.env; 12 13 import java.io.File ; 14 import java.io.IOException ; 15 import java.io.OutputStream ; 16 import java.io.PrintWriter ; 17 import java.io.Writer ; 18 19 import com.sun.mirror.apt.Filer; 20 21 27 final class ReconcileFilerImpl extends FilerImpl { 28 29 private final ReconcileEnv _env; 30 31 private static final OutputStream NO_OP_STREAM = new OutputStream (){ 32 public void write(int b) throws IOException { 33 return; 34 } 35 }; 36 37 private static final class NoOpWriter extends Writer { 38 public void write(char[] cbuf, int off, int len) 39 throws IOException { 40 return; 41 } 42 public void flush() throws IOException { 43 return; 44 } 45 public void close() throws IOException { 46 return; 47 } 48 } 49 50 public ReconcileFilerImpl(ReconcileEnv env) { 51 _env = env; 52 } 53 54 @Override 55 protected AbstractCompilationEnv getEnv() { 56 return _env; 57 } 58 59 private static final PrintWriter NO_OP_WRITER = new PrintWriter (new NoOpWriter()); 60 61 public OutputStream createBinaryFile(Filer.Location loc, String pkg, File relPath) 62 throws IOException { 63 return NO_OP_STREAM; 64 } 65 66 public OutputStream createClassFile(String name) throws IOException { 67 return NO_OP_STREAM; 68 } 69 70 public PrintWriter createTextFile(Filer.Location loc, String pkg, File relPath, String charsetName) 71 throws IOException { 72 return NO_OP_WRITER; 73 } 74 } | Popular Tags |