com.sun.tools.javac.file
Class BaseFileObject

java.lang.Object
  extended by com.sun.tools.javac.file.BaseFileObject
All Implemented Interfaces:
FileObject, JavaFileObject
Direct Known Subclasses:
ClassReader.SourceFileObject, RegularFileObject, ZipArchive.ZipFileObject, ZipFileIndexArchive.ZipFileIndexFileObject

public abstract class BaseFileObject
extends java.lang.Object
implements JavaFileObject


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind
 
Field Summary
protected  JavacFileManager fileManager
          The file manager that created this JavaFileObject.
 
Constructor Summary
protected BaseFileObject(JavacFileManager fileManager)
           
 
Method Summary
 Modifier getAccessLevel()
          Provides a hint about the access level of the class represented by this file object.
protected  java.nio.charset.CharsetDecoder getDecoder(boolean ignoreEncodingErrors)
           
 JavaFileObject.Kind getKind()
          Gets the kind of this file object.
abstract  java.lang.String getName()
          Deprecated. see bug 6410637
 NestingKind getNestingKind()
          Provides a hint about the nesting level of the class represented by this file object.
 java.lang.String getPath()
          Deprecated. see bug 6410637
protected abstract  java.lang.String inferBinaryName(java.lang.Iterable<? extends java.io.File> path)
           
 java.io.Reader openReader(boolean ignoreEncodingErrors)
          Gets a reader for this object.
protected static java.lang.String removeExtension(java.lang.String fileName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.tools.JavaFileObject
isNameCompatible
 
Methods inherited from interface javax.tools.FileObject
delete, getCharContent, getLastModified, openInputStream, openOutputStream, openWriter, toUri
 

Field Detail

fileManager

protected final JavacFileManager fileManager
The file manager that created this JavaFileObject.

Constructor Detail

BaseFileObject

protected BaseFileObject(JavacFileManager fileManager)
Method Detail

getKind

public JavaFileObject.Kind getKind()
Description copied from interface: JavaFileObject
Gets the kind of this file object.

Specified by:
getKind in interface JavaFileObject
Returns:
the kind

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPath

@Deprecated
public java.lang.String getPath()
Deprecated. see bug 6410637


getName

@Deprecated
public abstract java.lang.String getName()
Deprecated. see bug 6410637

Description copied from interface: FileObject
Gets a user-friendly name for this file object. The exact value returned is not specified but implementations should take care to preserve names as given by the user. For example, if the user writes the filename "BobsApp\Test.java" on the command line, this method should return "BobsApp\Test.java" whereas the toUri method might return file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java.

Specified by:
getName in interface FileObject
Returns:
a user-friendly name

getNestingKind

public NestingKind getNestingKind()
Description copied from interface: JavaFileObject
Provides a hint about the nesting level of the class represented by this file object. This method may return NestingKind.MEMBER to mean NestingKind.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 in interface JavaFileObject
Returns:
the nesting kind, or null if the nesting kind is not known

getAccessLevel

public Modifier getAccessLevel()
Description copied from interface: JavaFileObject
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 in interface JavaFileObject
Returns:
the access level

openReader

public java.io.Reader openReader(boolean ignoreEncodingErrors)
                          throws java.io.IOException
Description copied from interface: FileObject
Gets a reader for this object. The returned reader will replace bytes that cannot be decoded with the default translation character. In addition, the reader may report a diagnostic unless ignoreEncodingErrors is true.

Specified by:
openReader in interface FileObject
Parameters:
ignoreEncodingErrors - ignore encoding errors if true
Returns:
a Reader
Throws:
java.io.IOException - if an I/O error occurred

getDecoder

protected java.nio.charset.CharsetDecoder getDecoder(boolean ignoreEncodingErrors)

inferBinaryName

protected abstract java.lang.String inferBinaryName(java.lang.Iterable<? extends java.io.File> path)

removeExtension

protected static java.lang.String removeExtension(java.lang.String fileName)