0N/A/*
553N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
0N/A */
0N/A
0N/Apackage javax.tools;
0N/A
0N/Aimport java.io.IOException;
0N/Aimport java.net.URI;
0N/Aimport java.util.Iterator;
0N/Aimport java.util.Set;
0N/Aimport javax.tools.JavaFileObject.Kind;
0N/A
0N/A/**
0N/A * Forwards calls to a given file manager. Subclasses of this class
0N/A * might override some of these methods and might also provide
0N/A * additional fields and methods.
0N/A *
0N/A * @param <M> the kind of file manager forwarded to by this object
0N/A * @author Peter von der Ah&eacute;
0N/A * @since 1.6
0N/A */
0N/Apublic class ForwardingJavaFileManager<M extends JavaFileManager> implements JavaFileManager {
0N/A
0N/A /**
0N/A * The file manager which all methods are delegated to.
0N/A */
0N/A protected final M fileManager;
0N/A
0N/A /**
0N/A * Creates a new instance of ForwardingJavaFileManager.
0N/A * @param fileManager delegate to this file manager
0N/A */
0N/A protected ForwardingJavaFileManager(M fileManager) {
0N/A fileManager.getClass(); // null check
0N/A this.fileManager = fileManager;
0N/A }
0N/A
0N/A /**
0N/A * @throws SecurityException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public ClassLoader getClassLoader(Location location) {
0N/A return fileManager.getClassLoader(location);
0N/A }
0N/A
0N/A /**
0N/A * @throws IOException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public Iterable<JavaFileObject> list(Location location,
0N/A String packageName,
0N/A Set<Kind> kinds,
0N/A boolean recurse)
0N/A throws IOException
0N/A {
0N/A return fileManager.list(location, packageName, kinds, recurse);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public String inferBinaryName(Location location, JavaFileObject file) {
0N/A return fileManager.inferBinaryName(location, file);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A public boolean isSameFile(FileObject a, FileObject b) {
0N/A return fileManager.isSameFile(a, b);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public boolean handleOption(String current, Iterator<String> remaining) {
0N/A return fileManager.handleOption(current, remaining);
0N/A }
0N/A
0N/A public boolean hasLocation(Location location) {
0N/A return fileManager.hasLocation(location);
0N/A }
0N/A
0N/A public int isSupportedOption(String option) {
0N/A return fileManager.isSupportedOption(option);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public JavaFileObject getJavaFileForInput(Location location,
0N/A String className,
0N/A Kind kind)
0N/A throws IOException
0N/A {
0N/A return fileManager.getJavaFileForInput(location, className, kind);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public JavaFileObject getJavaFileForOutput(Location location,
0N/A String className,
0N/A Kind kind,
0N/A FileObject sibling)
0N/A throws IOException
0N/A {
0N/A return fileManager.getJavaFileForOutput(location, className, kind, sibling);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public FileObject getFileForInput(Location location,
0N/A String packageName,
0N/A String relativeName)
0N/A throws IOException
0N/A {
0N/A return fileManager.getFileForInput(location, packageName, relativeName);
0N/A }
0N/A
0N/A /**
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A * @throws IllegalStateException {@inheritDoc}
0N/A */
0N/A public FileObject getFileForOutput(Location location,
0N/A String packageName,
0N/A String relativeName,
0N/A FileObject sibling)
0N/A throws IOException
0N/A {
0N/A return fileManager.getFileForOutput(location, packageName, relativeName, sibling);
0N/A }
0N/A
0N/A public void flush() throws IOException {
0N/A fileManager.flush();
0N/A }
0N/A
0N/A public void close() throws IOException {
0N/A fileManager.close();
0N/A }
0N/A}