APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.javac.code

public Class ModuleFinder

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Arrays, .HashMap, .Iterator, .Map, .NoSuchElementException, .Set, java.util.function.Function, javax.tools.JavaFileManager, .JavaFileManager.Location, .JavaFileObject, .JavaFileObject.Kind, .StandardLocation, com.sun.tools.javac.code.Symbol.ClassSymbol, .Symbol.Completer, .Symbol.CompletionFailure, .Symbol.ModuleSymbol, com.sun.tools.javac.jvm.ModuleNameReader, .ModuleNameReader.BadClassFile, com.sun.tools.javac.resources.CompilerProperties.Errors, .CompilerProperties.Fragments, com.sun.tools.javac.util.Assert, .Context, .JCDiagnostic, .JCDiagnostic.Fragment, .List, .ListBuffer, .Log, .Name, .Names

This class provides operations to locate module definitions from the source and class files on the paths provided to javac.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
public static interface

Field Summary

Modifier and TypeField and Description
private final ClassFinder
private final DeferredCompletionFailureHandler
private final JCDiagnostic.Factory
private final JavaFileManager
fileManager

Access to files

private final Log
log

The log to use for verbose output.

protected static final Context.Key<ModuleFinder>
moduleFinderKey

The context key for the module finder.

pack-priv ModuleFinder.ModuleLocationIterator
public ModuleFinder.ModuleNameFromSourceReader
private ModuleNameReader
private final Names
names

The name table.

private final Symtab
syms

The symbol table.

Constructor Summary

AccessConstructor and Description
protected
ModuleFinder(Context context)

Construct a new module finder.

Method Summary

Modifier and TypeMethod and Description
public List<Symbol.ModuleSymbol>
public Symbol.ModuleSymbol
public Symbol.ModuleSymbol
private void
public Symbol.ModuleSymbol
pack-priv JCDiagnostic.Fragment
private JavaFileObject
public static ModuleFinder
instance(Context context)

Get the ModuleFinder instance for this invocation.

private JavaFileObject
private Symbol.ModuleSymbol
private String
private List<Symbol.ModuleSymbol>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classFinderback to summary
private final ClassFinder classFinder
dcfhback to summary
private final DeferredCompletionFailureHandler dcfh
diagsback to summary
private final JCDiagnostic.Factory diags
fileManagerback to summary
private final JavaFileManager fileManager

Access to files

logback to summary
private final Log log

The log to use for verbose output.

moduleFinderKeyback to summary
protected static final Context.Key<ModuleFinder> moduleFinderKey

The context key for the module finder.

moduleLocationIteratorback to summary
pack-priv ModuleFinder.ModuleLocationIterator moduleLocationIterator
moduleNameFromSourceReaderback to summary
public ModuleFinder.ModuleNameFromSourceReader moduleNameFromSourceReader
moduleNameReaderback to summary
private ModuleNameReader moduleNameReader
namesback to summary
private final Names names

The name table.

symsback to summary
private final Symtab syms

The symbol table.

Constructor Detail

ModuleFinderback to summary
protected ModuleFinder(Context context)

Construct a new module finder.

Annotations
@SuppressWarnings:this-escape

Method Detail

findAllModulesback to summary
public List<Symbol.ModuleSymbol> findAllModules()
findModuleback to summary
public Symbol.ModuleSymbol findModule(Name name)
findModuleback to summary
public Symbol.ModuleSymbol findModule(Symbol.ModuleSymbol msym)
findModuleInfoback to summary
private void findModuleInfo(Symbol.ModuleSymbol msym)
findSingleModuleback to summary
public Symbol.ModuleSymbol findSingleModule()
getDescriptionback to summary
pack-priv JCDiagnostic.Fragment getDescription(StandardLocation l)
getModuleInfoFromLocationback to summary
private JavaFileObject getModuleInfoFromLocation(JavaFileManager.Location location, JavaFileObject.Kind kind) throws IOException
instanceback to summary
public static ModuleFinder instance(Context context)

Get the ModuleFinder instance for this invocation.

preferredFileObjectback to summary
private JavaFileObject preferredFileObject(JavaFileObject fo1, JavaFileObject fo2)
readModuleback to summary
private Symbol.ModuleSymbol readModule(JavaFileObject fo) throws IOException
readModuleNameback to summary
private String readModuleName(JavaFileObject jfo) throws IOException, BadClassFile
scanModulePathback to summary
private List<Symbol.ModuleSymbol> scanModulePath(Symbol.ModuleSymbol toFind)
com.sun.tools.javac.code back to summary

pack-priv Class ModuleFinder.ModuleLocationIterator

extends Object
implements Iterator<Set<JavaFileManager.Location>>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
pack-priv Iterator<Set<JavaFileManager.Location>>
pack-priv Set<JavaFileManager.Location>
pack-priv StandardLocation
pack-priv Iterator<StandardLocation>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public Set<JavaFileManager.Location>
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

innerIterback to summary
pack-priv Iterator<Set<JavaFileManager.Location>> innerIter
nextback to summary
pack-priv Set<JavaFileManager.Location> next
outerback to summary
pack-priv StandardLocation outer
outerIterback to summary
pack-priv Iterator<StandardLocation> outerIter

Constructor Detail

ModuleLocationIteratorback to summary
pack-priv ModuleLocationIterator()

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Annotations
@Override
nextback to summary
public Set<JavaFileManager.Location> next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Annotations
@Override
com.sun.tools.javac.code back to summary

public Interface ModuleFinder.ModuleNameFromSourceReader


Method Summary

Modifier and TypeMethod and Description
public Name

Method Detail

readModuleNameback to summary
public Name readModuleName(JavaFileObject file)