@Override public FileObject getResource(Location location, CharSequence pkg, CharSequence relativeName) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForInput( location, pkg.toString(), relativeName.toString()); if (fo == null) { throw new FileNotFoundException("Resource does not exist : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */); _filer.addNewUnit(unit); break; case CLASS : _filer.addNewClassFile(type); } catch (IOException e) { if (type != null && type.isValidBinding()) { if (type.isBinaryBinding()) { _filer.addNewClassFile(type); } else { BinaryTypeBinding binaryBinding = new BinaryTypeBinding(type.getPackage(), binaryType, this._filer._env._compiler.lookupEnvironment, true); if (binaryBinding != null) _filer.addNewClassFile(binaryBinding);
_filer = new BatchFilerImpl(_dispatchManager, this); _messager = new BatchMessagerImpl(this, _compilerOwner);
case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */); _filer.addNewUnit(unit); break; case CLASS : _filer.addNewClassFile(type); } catch (IOException e) { if (type != null && type.isValidBinding()) { if (type.isBinaryBinding()) { _filer.addNewClassFile(type); } else { BinaryTypeBinding binaryBinding = new BinaryTypeBinding(type.getPackage(), binaryType, this._filer._env._compiler.lookupEnvironment, true); if (binaryBinding != null) _filer.addNewClassFile(binaryBinding);
_filer = new BatchFilerImpl(_dispatchManager, this); _messager = new BatchMessagerImpl(this, _compilerOwner);
case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */); _filer.addNewUnit(unit); break; case CLASS : _filer.addNewClassFile(type); } catch (IOException e) { if (type != null && type.isValidBinding()) { if (type.isBinaryBinding()) { _filer.addNewClassFile(type); } else { BinaryTypeBinding binaryBinding = new BinaryTypeBinding(type.getPackage(), binaryType, this._filer._env._compiler.lookupEnvironment, true); if (binaryBinding != null) _filer.addNewClassFile(binaryBinding);
@Override public FileObject createResource(Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForOutput( location, pkg.toString(), relativeName.toString(), null); URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
_filer = new BatchFilerImpl(_dispatchManager, this); _messager = new BatchMessagerImpl(this, _compilerOwner);
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 FileObject createResource(Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForOutput( location, pkg.toString(), relativeName.toString(), null); URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
_filer = new BatchFilerImpl(_dispatchManager, this); _messager = new BatchMessagerImpl(this, _compilerOwner);
case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */); _filer.addNewUnit(unit); break; case CLASS : ReferenceBinding type = this._filer._env._compiler.lookupEnvironment.getType(CharOperation.splitOn('/', name)); if (type != null && type.isValidBinding() && type.isBinaryBinding()) { _filer.addNewClassFile(type);
@Override public FileObject createResource(Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForOutput( location, pkg.toString(), relativeName.toString(), null); URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
_filer = new BatchFilerImpl(_dispatchManager, this); _messager = new BatchMessagerImpl(this, _compilerOwner);
case SOURCE : CompilationUnit unit = new CompilationUnit(null, _fileName, null /* encoding */); _filer.addNewUnit(unit); break; case CLASS : ReferenceBinding type = this._filer._env._compiler.lookupEnvironment.getType(CharOperation.splitOn('/', name)); if (type != null && type.isValidBinding() && type.isBinaryBinding()) { _filer.addNewClassFile(type);
@Override public FileObject getResource(Location location, CharSequence pkg, CharSequence relativeName) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForInput( location, pkg.toString(), relativeName.toString()); if (fo == null) { throw new FileNotFoundException("Resource does not exist : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
_filer = new BatchFilerImpl(_dispatchManager, this); _messager = new BatchMessagerImpl(this, _compilerOwner);
@Override public FileObject getResource(Location location, CharSequence pkg, CharSequence relativeName) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForInput( location, pkg.toString(), relativeName.toString()); if (fo == null) { throw new FileNotFoundException("Resource does not exist : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
@Override public FileObject createResource(Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForOutput( location, pkg.toString(), relativeName.toString(), null); URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }
@Override public FileObject createResource(Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { validateName(relativeName); FileObject fo = _fileManager.getFileForOutput( location, pkg.toString(), relativeName.toString(), null); URI uri = fo.toUri(); if (_createdFiles.contains(uri)) { throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$ } _createdFiles.add(uri); return fo; }