ForwardingJavaFileObject (Java SE 16 & JDK 16) (original) (raw)
Type Parameters:
F
- the kind of file object forwarded to by this object
All Implemented Interfaces:
[FileObject](FileObject.html "interface in javax.tools")
, [JavaFileObject](JavaFileObject.html "interface in javax.tools")
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
Field Summary
Constructor Summary
Constructorsprotected
[ForwardingJavaFileObject](#%3Cinit%3E%28F%29)​([F](ForwardingJavaFileObject.html "type parameter in ForwardingJavaFileObject") fileObject)
Creates a new instance of ForwardingJavaFileObject
.
Method Summary
Provides a hint about the access level of the class represented by this file object.[getKind](#getKind%28%29)()
Returns the kind of this file object.
Provides a hint about the nesting level of the class represented by this file object.boolean
Checks if this file object is compatible with the specified simple name and kind.
Methods declared in class java.lang.Object
[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)
Constructor Details
ForwardingJavaFileObject
protected ForwardingJavaFileObject​(F fileObject)
Creates a new instance ofForwardingJavaFileObject
.
Parameters:
fileObject
- delegate to this file objectMethod Details
getKind
Returns the kind of this file object.
Specified by:
[getKind](JavaFileObject.html#getKind%28%29)
in interface[JavaFileObject](JavaFileObject.html "interface in javax.tools")
Returns:
the kindisNameCompatible
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.
Specified by:
[isNameCompatible](JavaFileObject.html#isNameCompatible%28java.lang.String,javax.tools.JavaFileObject.Kind%29)
in interface[JavaFileObject](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
otherwisegetNestingKind
Provides a hint about the nesting level of the class represented by this file object. This method may returnNestingKind.MEMBER to meanNestingKind.LOCAL or NestingKind.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](JavaFileObject.html#getNestingKind%28%29)
in interface[JavaFileObject](JavaFileObject.html "interface in javax.tools")
Returns:
the nesting kind, ornull
if the nesting kind is not knowngetAccessLevel
Provides a hint about the access level of the class represented by this file object. If the access level is not known or this file object does not represent a class file this method returns
null
.
Specified by:
[getAccessLevel](JavaFileObject.html#getAccessLevel%28%29)
in interface[JavaFileObject](JavaFileObject.html "interface in javax.tools")
Returns:
the access level