ForwardingJavaFileObject (Java Platform SE 8 ) (original) (raw)
- javax.tools.ForwardingFileObject
- javax.tools.ForwardingJavaFileObject
Type Parameters:
F
- the kind of file object forwarded to by this object
All Implemented Interfaces:
FileObject, JavaFileObject
public class ForwardingJavaFileObject<F extends JavaFileObject>
extends ForwardingFileObject
implements JavaFileObject
Forwards calls to a given file object. Subclasses of this class might override some of these methods and might also provide additional fields and methods.
Since:
1.6
Nested Class Summary
* ### Nested classes/interfaces inherited from interface javax.tools.[JavaFileObject](../../javax/tools/JavaFileObject.html "interface in javax.tools") `[JavaFileObject.Kind](../../javax/tools/JavaFileObject.Kind.html "enum in javax.tools")`
Field Summary
* ### Fields inherited from class javax.tools.[ForwardingFileObject](../../javax/tools/ForwardingFileObject.html "class in javax.tools") `[fileObject](../../javax/tools/ForwardingFileObject.html#fileObject)`
Constructor Summary
Constructors
Modifier Constructor Description protected ForwardingJavaFileObject(F fileObject) Creates a new instance of ForwardingJavaFileObject. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description Modifier getAccessLevel() Provides a hint about the access level of the class represented by this file object. JavaFileObject.Kind getKind() Gets the kind of this file object. NestingKind getNestingKind() Provides a hint about the nesting level of the class represented by this file object. boolean isNameCompatible(String simpleName,JavaFileObject.Kind kind) Checks if this file object is compatible with the specified simple name and kind. * ### Methods inherited from class javax.tools.[ForwardingFileObject](../../javax/tools/ForwardingFileObject.html "class in javax.tools") `[delete](../../javax/tools/ForwardingFileObject.html#delete--), [getCharContent](../../javax/tools/ForwardingFileObject.html#getCharContent-boolean-), [getLastModified](../../javax/tools/ForwardingFileObject.html#getLastModified--), [getName](../../javax/tools/ForwardingFileObject.html#getName--), [openInputStream](../../javax/tools/ForwardingFileObject.html#openInputStream--), [openOutputStream](../../javax/tools/ForwardingFileObject.html#openOutputStream--), [openReader](../../javax/tools/ForwardingFileObject.html#openReader-boolean-), [openWriter](../../javax/tools/ForwardingFileObject.html#openWriter--), [toUri](../../javax/tools/ForwardingFileObject.html#toUri--)` * ### Methods inherited from class java.lang.[Object](../../java/lang/Object.html "class in java.lang") `[clone](../../java/lang/Object.html#clone--), [equals](../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../java/lang/Object.html#finalize--), [getClass](../../java/lang/Object.html#getClass--), [hashCode](../../java/lang/Object.html#hashCode--), [notify](../../java/lang/Object.html#notify--), [notifyAll](../../java/lang/Object.html#notifyAll--), [toString](../../java/lang/Object.html#toString--), [wait](../../java/lang/Object.html#wait--), [wait](../../java/lang/Object.html#wait-long-), [wait](../../java/lang/Object.html#wait-long-int-)` * ### Methods inherited from interface javax.tools.[FileObject](../../javax/tools/FileObject.html "interface in javax.tools") `[delete](../../javax/tools/FileObject.html#delete--), [getCharContent](../../javax/tools/FileObject.html#getCharContent-boolean-), [getLastModified](../../javax/tools/FileObject.html#getLastModified--), [getName](../../javax/tools/FileObject.html#getName--), [openInputStream](../../javax/tools/FileObject.html#openInputStream--), [openOutputStream](../../javax/tools/FileObject.html#openOutputStream--), [openReader](../../javax/tools/FileObject.html#openReader-boolean-), [openWriter](../../javax/tools/FileObject.html#openWriter--), [toUri](../../javax/tools/FileObject.html#toUri--)`
Constructor Detail
* #### ForwardingJavaFileObject protected ForwardingJavaFileObject([F](../../javax/tools/ForwardingJavaFileObject.html "type parameter in ForwardingJavaFileObject") fileObject) Creates a new instance of ForwardingJavaFileObject. Parameters: `fileObject` \- delegate to this file object
Method Detail
* #### getKind public [JavaFileObject.Kind](../../javax/tools/JavaFileObject.Kind.html "enum in javax.tools") getKind() Gets the kind of this file object. Specified by: `[getKind](../../javax/tools/JavaFileObject.html#getKind--)` in interface `[JavaFileObject](../../javax/tools/JavaFileObject.html "interface in javax.tools")` Returns: the kind * #### isNameCompatible public boolean isNameCompatible([String](../../java/lang/String.html "class in java.lang") simpleName, [JavaFileObject.Kind](../../javax/tools/JavaFileObject.Kind.html "enum in javax.tools") kind) Checks if this file object is compatible with the specified simple name and kind. A simple name is a single identifier (not qualified) as defined inThe Java™ Language Specification, section 6.2 "Names and Identifiers". Specified by: `[isNameCompatible](../../javax/tools/JavaFileObject.html#isNameCompatible-java.lang.String-javax.tools.JavaFileObject.Kind-)` in interface `[JavaFileObject](../../javax/tools/JavaFileObject.html "interface in javax.tools")` Parameters: `simpleName` \- a simple name of a class `kind` \- a kind Returns: `true` if this file object is compatible; false otherwise * #### getNestingKind public [NestingKind](../../javax/lang/model/element/NestingKind.html "enum in javax.lang.model.element") getNestingKind() Provides a hint about the nesting level of the class represented by this file object. This method may return[NestingKind.MEMBER](../../javax/lang/model/element/NestingKind.html#MEMBER) to mean[NestingKind.LOCAL](../../javax/lang/model/element/NestingKind.html#LOCAL) or [NestingKind.ANONYMOUS](../../javax/lang/model/element/NestingKind.html#ANONYMOUS). If the nesting level is not known or this file object does not represent a class file this method returns `null`. Specified by: `[getNestingKind](../../javax/tools/JavaFileObject.html#getNestingKind--)` in interface `[JavaFileObject](../../javax/tools/JavaFileObject.html "interface in javax.tools")` Returns: the nesting kind, or `null` if the nesting kind is not known * #### getAccessLevel public [Modifier](../../javax/lang/model/element/Modifier.html "enum in javax.lang.model.element") getAccessLevel() Provides a hint about the access level of the class represented by this file object. If the access level is not known or if this file object does not represent a class file this method returns `null`. Specified by: `[getAccessLevel](../../javax/tools/JavaFileObject.html#getAccessLevel--)` in interface `[JavaFileObject](../../javax/tools/JavaFileObject.html "interface in javax.tools")` Returns: the access level
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.