public class ExtFileManager extends javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager> implements FileManager
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.Set<javax.tools.JavaFileObject.Kind> |
ALL_KINDS |
protected static int |
BUF_SIZE |
protected int |
caseInsensitive
Indicates if the file system is case-insensitive.
|
protected boolean |
caseInsensitivityComputed
Indicates if the file system case-sensitivity is set
|
protected static java.util.List<javax.tools.JavaFileManager.Location> |
default_locations |
protected ExtensionInfo |
extInfo |
protected boolean |
inMemory
Indicates whether to keep output files in memory.
|
protected static javax.tools.JavaCompiler |
javaCompiler |
protected java.util.Map<java.lang.String,FileSource> |
loadedSources
Map of sources already loaded
|
protected static java.util.Set<java.lang.String> |
nocache
A cache for the class files that don't exist
|
protected static java.lang.Object |
not_found |
protected java.util.Map<javax.tools.JavaFileManager.Location,java.util.Map<java.lang.String,javax.tools.JavaFileObject>> |
objectMap
Map for storing in-memory FileObjects and associated fully qualified
names
|
protected static java.util.Map<java.lang.String,java.lang.Boolean> |
packageCache
A cache for package look ups
|
protected static java.util.Collection<java.lang.String> |
report_topics |
protected static java.util.Collection<java.lang.String> |
verbose |
protected static java.util.Map<java.io.File,java.lang.Object> |
zipCache |
| Constructor and Description |
|---|
ExtFileManager(ExtensionInfo extInfo) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
caseInsensitive() |
protected FileSource |
checkForSource(javax.tools.JavaFileManager.Location location,
java.lang.String className)
Load the source file for the given class name using the source path.
|
FileSource |
classSource(javax.tools.JavaFileManager.Location location,
java.lang.String className) |
FileSource |
classSource(java.lang.String className) |
protected void |
clearCache() |
protected java.lang.String |
fileKey(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.lang.String fileName) |
protected java.lang.String |
fileKey(java.lang.String packageName,
java.lang.String relativeName) |
FileSource |
fileSource(javax.tools.JavaFileManager.Location location,
java.lang.String fileName)
Obtains a FileSource for a dependency.
|
FileSource |
fileSource(javax.tools.JavaFileManager.Location location,
java.lang.String fileName,
boolean userSpecified)
Deprecated.
|
FileSource |
fileSource(javax.tools.JavaFileManager.Location location,
java.lang.String fileName,
Source.Kind kind) |
FileSource |
fileSource(java.lang.String fileName)
Obtains a FileSource for a dependency.
|
FileSource |
fileSource(java.lang.String fileName,
boolean userSpecified)
Deprecated.
|
FileSource |
fileSource(java.lang.String fileName,
Source.Kind kind) |
static byte[] |
getBytes(javax.tools.FileObject fo)
Convenience method for extracting bytes from a FileObject
|
javax.tools.FileObject |
getFileForInput(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.lang.String relativeName) |
javax.tools.FileObject |
getFileForOutput(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.lang.String relativeName,
javax.tools.FileObject sibling) |
javax.tools.JavaFileObject |
getJavaFileForInput(javax.tools.JavaFileManager.Location location,
java.lang.String className,
javax.tools.JavaFileObject.Kind kind) |
javax.tools.JavaFileObject |
getJavaFileForOutput(javax.tools.JavaFileManager.Location location,
java.lang.String className,
javax.tools.JavaFileObject.Kind kind,
javax.tools.FileObject sibling) |
java.lang.Iterable<? extends javax.tools.JavaFileObject> |
getJavaFileObjects(java.io.File... files) |
java.lang.Iterable<? extends javax.tools.JavaFileObject> |
getJavaFileObjects(java.lang.String... names) |
java.lang.Iterable<? extends javax.tools.JavaFileObject> |
getJavaFileObjectsFromFiles(java.lang.Iterable<? extends java.io.File> files) |
java.lang.Iterable<? extends javax.tools.JavaFileObject> |
getJavaFileObjectsFromStrings(java.lang.Iterable<java.lang.String> names) |
java.lang.Iterable<? extends java.io.File> |
getLocation(javax.tools.JavaFileManager.Location location) |
boolean |
hasLocation(javax.tools.JavaFileManager.Location location) |
java.lang.String |
inferBinaryName(javax.tools.JavaFileManager.Location location,
javax.tools.JavaFileObject file) |
boolean |
isSameFile(javax.tools.FileObject a,
javax.tools.FileObject b) |
protected javax.tools.JavaFileObject.Kind |
kindFromExtension(java.lang.String name) |
java.lang.Iterable<javax.tools.JavaFileObject> |
list(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.util.Set<javax.tools.JavaFileObject.Kind> kinds,
boolean recurse) |
ClassFile |
loadFile(javax.tools.JavaFileManager.Location location,
java.lang.String name) |
ClassFile |
loadFile(java.lang.String name) |
protected static java.util.zip.ZipFile |
loadZip(java.io.File dir) |
boolean |
packageExists(javax.tools.JavaFileManager.Location location,
java.lang.String name) |
boolean |
packageExists(java.lang.String name) |
void |
setLocation(javax.tools.JavaFileManager.Location location,
java.lang.Iterable<? extends java.io.File> path) |
close, flush, getClassLoader, handleOption, isSupportedOptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected static final javax.tools.JavaCompiler javaCompiler
protected final ExtensionInfo extInfo
protected final java.util.Map<java.lang.String,FileSource> loadedSources
protected static final java.util.Map<java.lang.String,java.lang.Boolean> packageCache
protected static final java.util.Set<java.lang.String> nocache
protected static final java.util.Map<java.io.File,java.lang.Object> zipCache
protected static final java.lang.Object not_found
protected static final int BUF_SIZE
protected static final java.util.Collection<java.lang.String> report_topics
protected static final java.util.Set<javax.tools.JavaFileObject.Kind> ALL_KINDS
protected final java.util.Map<javax.tools.JavaFileManager.Location,java.util.Map<java.lang.String,javax.tools.JavaFileObject>> objectMap
protected int caseInsensitive
protected boolean caseInsensitivityComputed
protected final boolean inMemory
protected static java.util.List<javax.tools.JavaFileManager.Location> default_locations
protected static java.util.Collection<java.lang.String> verbose
public ExtFileManager(ExtensionInfo extInfo)
protected void clearCache()
public javax.tools.FileObject getFileForInput(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.lang.String relativeName)
throws java.io.IOException
getFileForInput in interface javax.tools.JavaFileManagergetFileForInput in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>java.io.IOExceptionpublic javax.tools.JavaFileObject getJavaFileForInput(javax.tools.JavaFileManager.Location location,
java.lang.String className,
javax.tools.JavaFileObject.Kind kind)
throws java.io.IOException
getJavaFileForInput in interface javax.tools.JavaFileManagergetJavaFileForInput in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>java.io.IOExceptionprotected javax.tools.JavaFileObject.Kind kindFromExtension(java.lang.String name)
public javax.tools.FileObject getFileForOutput(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.lang.String relativeName,
javax.tools.FileObject sibling)
throws java.io.IOException
getFileForOutput in interface javax.tools.JavaFileManagergetFileForOutput in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>java.io.IOExceptionprotected java.lang.String fileKey(java.lang.String packageName,
java.lang.String relativeName)
public javax.tools.JavaFileObject getJavaFileForOutput(javax.tools.JavaFileManager.Location location,
java.lang.String className,
javax.tools.JavaFileObject.Kind kind,
javax.tools.FileObject sibling)
throws java.io.IOException
getJavaFileForOutput in interface javax.tools.JavaFileManagergetJavaFileForOutput in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>java.io.IOExceptionpublic boolean hasLocation(javax.tools.JavaFileManager.Location location)
hasLocation in interface javax.tools.JavaFileManagerhasLocation in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>public java.lang.String inferBinaryName(javax.tools.JavaFileManager.Location location,
javax.tools.JavaFileObject file)
inferBinaryName in interface javax.tools.JavaFileManagerinferBinaryName in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>public java.lang.Iterable<javax.tools.JavaFileObject> list(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.util.Set<javax.tools.JavaFileObject.Kind> kinds,
boolean recurse)
throws java.io.IOException
list in interface javax.tools.JavaFileManagerlist in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>java.io.IOExceptionpublic java.lang.Iterable<? extends javax.tools.JavaFileObject> getJavaFileObjects(java.io.File... files)
getJavaFileObjects in interface javax.tools.StandardJavaFileManagerpublic java.lang.Iterable<? extends javax.tools.JavaFileObject> getJavaFileObjects(java.lang.String... names)
getJavaFileObjects in interface javax.tools.StandardJavaFileManagerpublic java.lang.Iterable<? extends javax.tools.JavaFileObject> getJavaFileObjectsFromFiles(java.lang.Iterable<? extends java.io.File> files)
getJavaFileObjectsFromFiles in interface javax.tools.StandardJavaFileManagerpublic java.lang.Iterable<? extends javax.tools.JavaFileObject> getJavaFileObjectsFromStrings(java.lang.Iterable<java.lang.String> names)
getJavaFileObjectsFromStrings in interface javax.tools.StandardJavaFileManagerpublic java.lang.Iterable<? extends java.io.File> getLocation(javax.tools.JavaFileManager.Location location)
getLocation in interface javax.tools.StandardJavaFileManagerpublic boolean isSameFile(javax.tools.FileObject a,
javax.tools.FileObject b)
isSameFile in interface javax.tools.JavaFileManagerisSameFile in interface javax.tools.StandardJavaFileManagerisSameFile in class javax.tools.ForwardingJavaFileManager<javax.tools.StandardJavaFileManager>public void setLocation(javax.tools.JavaFileManager.Location location,
java.lang.Iterable<? extends java.io.File> path)
throws java.io.IOException
setLocation in interface javax.tools.StandardJavaFileManagerjava.io.IOExceptionpublic boolean packageExists(java.lang.String name)
packageExists in interface SourceLoaderpackageExists in interface ClassFileLoadername - A package namename exists, otherwise falseprotected static java.util.zip.ZipFile loadZip(java.io.File dir)
throws java.io.IOException
java.io.IOExceptionpublic boolean packageExists(javax.tools.JavaFileManager.Location location,
java.lang.String name)
packageExists in interface SourceLoaderpackageExists in interface ClassFileLoaderlocation - A location to search a package name inname - A package namename exists, otherwise falsepublic ClassFile loadFile(java.lang.String name)
loadFile in interface ClassFileLoadername - A class namename.class file exists, otherwise
nullpublic ClassFile loadFile(javax.tools.JavaFileManager.Location location, java.lang.String name)
loadFile in interface ClassFileLoaderlocation - A location to load a ClassFile fromname - A class namename.class file exists in the
location, otherwise nullpublic FileSource fileSource(java.lang.String fileName) throws java.io.IOException
SourceLoaderfileSource in interface SourceLoaderfileName - A source file namefileName exists in
source pathjava.io.IOException@Deprecated public FileSource fileSource(java.lang.String fileName, boolean userSpecified) throws java.io.IOException
fileSource in interface SourceLoaderfileName - A source file nameuserSpecified - If the user has specified this source file explicitlyfileName exists in
source pathjava.io.IOExceptionpublic FileSource fileSource(java.lang.String fileName, Source.Kind kind) throws java.io.IOException
fileSource in interface SourceLoaderfileName - A source file namekind - How the source was foundfileName exists in
source pathjava.io.IOExceptionpublic FileSource fileSource(javax.tools.JavaFileManager.Location location, java.lang.String fileName) throws java.io.IOException
SourceLoaderfileSource in interface SourceLoaderlocation - A location to search a source file infileName - A source file namefileName existsjava.io.IOException@Deprecated public FileSource fileSource(javax.tools.JavaFileManager.Location location, java.lang.String fileName, boolean userSpecified) throws java.io.IOException
fileSource in interface SourceLoaderlocation - A location to search a source file infileName - A source file nameuserSpecified - If the user has specified this source file explicitlyfileName existsjava.io.IOExceptionpublic FileSource fileSource(javax.tools.JavaFileManager.Location location, java.lang.String fileName, Source.Kind kind) throws java.io.IOException
fileSource in interface SourceLoaderlocation - A location to search a source file inkind - How the source was foundfileName existsjava.io.IOExceptionpublic FileSource classSource(java.lang.String className)
classSource in interface SourceLoaderclassName - A class nameclassName if it exists in source path, otherwise
nullpublic FileSource classSource(javax.tools.JavaFileManager.Location location, java.lang.String className)
classSource in interface SourceLoaderlocation - A location to search a file in, that contains definition of
the class classNameclassName - A class nameclassName if it exists in location,
otherwise nullprotected FileSource checkForSource(javax.tools.JavaFileManager.Location location, java.lang.String className)
protected java.lang.String fileKey(javax.tools.JavaFileManager.Location location,
java.lang.String packageName,
java.lang.String fileName)
public boolean caseInsensitive()
caseInsensitive in interface SourceLoaderpublic static byte[] getBytes(javax.tools.FileObject fo)
throws java.io.IOException
java.io.IOException