@Override public void close() throws IOException { _w.close(); closed(); } @Override
@Override public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.CLASS_OUTPUT, name.toString(), JavaFileObject.Kind.CLASS, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Class file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); return new HookedJavaFileObject(jfo, jfo.getName(), name.toString(), this); }
protected void closed() { if (!_closed) { _closed = true; //TODO: support encoding switch(this.getKind()) { case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */); _filer.addNewUnit(unit); break; case CLASS : IBinaryType binaryType = null; try { binaryType = ClassFileReader.read(_fileName); } catch (ClassFormatException e) { // ignore } catch (IOException e) { // ignore } if (binaryType != null) { char[] name = binaryType.getName(); ReferenceBinding type = this._filer._env._compiler.lookupEnvironment.getType(CharOperation.splitOn('/', name)); if (type != null && type.isValidBinding() && type.isBinaryBinding()) { _filer.addNewClassFile(type); } } } } } }
@Override public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.CLASS_OUTPUT, name.toString(), JavaFileObject.Kind.CLASS, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Class file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); return new HookedJavaFileObject(jfo, jfo.getName(), name.toString(), this); }
_closed = true; switch(this.getKind()) { case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */);
@Override public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.CLASS_OUTPUT, name.toString(), JavaFileObject.Kind.CLASS, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Class file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); return new HookedJavaFileObject(jfo, jfo.getName(), name.toString(), this); }
@Override public void close() throws IOException { _os.close(); closed(); } @Override
_closed = true; switch(this.getKind()) { case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */);
@Override public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.SOURCE_OUTPUT, name.toString(), JavaFileObject.Kind.SOURCE, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Source file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); // hook the file object's writers to create compilation unit and add to addedUnits() return new HookedJavaFileObject(jfo, jfo.getName(), name.toString(), this); }
@Override public void close() throws IOException { _w.close(); closed(); } @Override
_closed = true; switch(this.getKind()) { case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */);
@Override public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.SOURCE_OUTPUT, name.toString(), JavaFileObject.Kind.SOURCE, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Source file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); // hook the file object's writers to create compilation unit and add to addedUnits() return new HookedJavaFileObject(jfo, jfo.getName(), name.toString(), this); }
@Override public void close() throws IOException { _os.close(); closed(); } @Override
_closed = true; switch(this.getKind()) { case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */);
@Override public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.CLASS_OUTPUT, name.toString(), JavaFileObject.Kind.CLASS, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Class file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); return new HookedJavaFileObject(jfo, jfo.getName(), this); }
@Override public void close() throws IOException { _os.close(); closed(); } @Override
_closed = true; switch(this.getKind()) { case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */);
@Override public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.CLASS_OUTPUT, name.toString(), JavaFileObject.Kind.CLASS, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Class file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); return new HookedJavaFileObject(jfo, jfo.getName(), this); }
@Override public void close() throws IOException { _w.close(); closed(); } @Override
@Override public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException { JavaFileObject jfo = _fileManager.getJavaFileForOutput( StandardLocation.SOURCE_OUTPUT, name.toString(), JavaFileObject.Kind.SOURCE, null); URI uri = jfo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Source file already created : " + name); //$NON-NLS-1$ } _createdFiles.add(uri); // hook the file object's writers to create compilation unit and add to addedUnits() return new HookedJavaFileObject(jfo, jfo.getName(), this); }