KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > tools > ForwardingJavaFileObject


1 /*
2  * @(#)ForwardingJavaFileObject.java 1.8 06/06/25
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.tools;
9
10 import java.io.IOException JavaDoc;
11 import java.io.InputStream JavaDoc;
12 import java.io.OutputStream JavaDoc;
13 import java.io.Reader JavaDoc;
14 import java.io.Writer JavaDoc;
15 import java.net.URI JavaDoc;
16 import javax.lang.model.element.Modifier;
17 import javax.lang.model.element.NestingKind;
18
19 /**
20  * Forwards calls to a given file object. Subclasses of this class
21  * might override some of these methods and might also provide
22  * additional fields and methods.
23  *
24  * @param <F> the kind of file object forwarded to by this object
25  * @author Peter von der Ah&eacute;
26  * @since 1.6
27  */

28 public class ForwardingJavaFileObject<F extends JavaFileObject>
29     extends ForwardingFileObject<F>
30     implements JavaFileObject
31 {
32
33     /**
34      * Creates a new instance of ForwardingJavaFileObject.
35      * @param fileObject delegate to this file object
36      */

37     protected ForwardingJavaFileObject(F fileObject) {
38     super(fileObject);
39     }
40
41     public Kind getKind() {
42         return fileObject.getKind();
43     }
44
45     public boolean isNameCompatible(String JavaDoc simpleName, Kind kind) {
46         return fileObject.isNameCompatible(simpleName, kind);
47     }
48
49     public NestingKind getNestingKind() { return fileObject.getNestingKind(); }
50
51     public Modifier getAccessLevel() { return fileObject.getAccessLevel(); }
52
53 }
54
Popular Tags