Class JavaSearchNameEnvironment
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.search.matching.JavaSearchNameEnvironment
- All Implemented Interfaces:
IModuleAwareNameEnvironment, INameEnvironment, SuffixConstants
public class JavaSearchNameEnvironment
extends Object
implements IModuleAwareNameEnvironment, SuffixConstants
-
Nested Class Summary
Nested classes/interfaces inherited from interface IModuleAwareNameEnvironment
IModuleAwareNameEnvironment.LookupStrategyModifier and TypeInterfaceDescriptionstatic enumStrategies for searching types and packages in classpath locations and modules. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedHashSet<ClasspathLocation> protected Map<String, LinkedHashSet<ClasspathLocation>> an index of qualified package names (separated by / not .) to classpath locationsFields inherited from interface SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVAModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final char[]static final char[]static final char[]static final char[]static final char[]static final char[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionJavaSearchNameEnvironment(IJavaProject javaProject, ICompilationUnit[] copies) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProjectClassPath(JavaProject javaProject) voidcleanup()This method cleans the environment.static INameEnvironmentcreateWithReferencedProjects(IJavaProject javaProject, List<IJavaProject> referencedProjects, ICompilationUnit[] copies) findType(char[][] compoundName, char[] moduleName) findType(char[] typeName, char[][] packageName, char[] moduleName) Answer a type identified by the given names.char[][]protected Iterable<ClasspathLocation> getLocationsFor(String moduleName, String qualifiedPackageName) getModule(char[] moduleName) Get the module with the given name, which must denote a named module.char[][]getModulesDeclaringPackage(char[][] packageName, char[] moduleName) static Map<String, ICompilationUnit> getWorkingCopyMap(ICompilationUnit[] copies) booleanhasCompilationUnit(char[][] qualifiedPackageName, char[] moduleName, boolean checkCUs) Answer whether the given package (within the given module) contains any compilation unit.char[][]listPackages(char[] moduleName) Lists all packages in the module identified by the given, real module name (i.e., this method is implemented only forIModuleAwareNameEnvironment.LookupStrategy.Named).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IModuleAwareNameEnvironment
applyModuleUpdates, findType, findType, getUniqueModulesDeclaringPackage, isOnModulePath, isPackageModifier and TypeMethodDescriptiondefault voidapplyModuleUpdates(IUpdatableModule module, IUpdatableModule.UpdateKind kind) Ask the name environment to perform any updates (add-exports or add-reads) to the given module.default NameEnvironmentAnswerfindType(char[][] compoundTypeName) Find a type with the given compound name.default NameEnvironmentAnswerfindType(char[] typeName, char[][] packageName) Find a type named<typeName>in the package<packageName>.default char[][]getUniqueModulesDeclaringPackage(char[][] packageName, char[] moduleName) default booleanIf this environment focusses on one IJavaProject answer if the given compilation unit is found on the module path, rather than the class path.default booleanisPackage(char[][] parentPackageName, char[] packageName) Answer whether packageName is the name of a known subpackage inside the package parentPackageName.
-
Field Details
-
locationSet
-
packageNameToClassPathLocations
an index of qualified package names (separated by / not .) to classpath locations
-
-
Constructor Details
-
JavaSearchNameEnvironment
-
-
Method Details
-
getWorkingCopyMap
-
cleanup
public void cleanup()Description copied from interface:INameEnvironmentThis method cleans the environment. It is responsible for releasing the memory and freeing resources. Passed that point, the name environment is no longer usable. A name environment can have a long life cycle, therefore it is the responsibility of the code which created it to decide when it is a good time to clean it up.- Specified by:
cleanupin interfaceINameEnvironment
-
addProjectClassPath
-
getLocationsFor
protected Iterable<ClasspathLocation> getLocationsFor(String moduleName, String qualifiedPackageName) -
findType
Description copied from interface:IModuleAwareNameEnvironmentAnswer a type identified by the given names. moduleName may be one of the special names from ModuleBinding (ANY, ANY_NAMED, UNNAMED).- Specified by:
findTypein interfaceIModuleAwareNameEnvironment
-
findType
- Specified by:
findTypein interfaceIModuleAwareNameEnvironment
-
getModulesDeclaringPackage
public char[][] getModulesDeclaringPackage(char[][] packageName, char[] moduleName) - Specified by:
getModulesDeclaringPackagein interfaceIModuleAwareNameEnvironment
-
listPackages
public char[][] listPackages(char[] moduleName) Description copied from interface:IModuleAwareNameEnvironmentLists all packages in the module identified by the given, real module name (i.e., this method is implemented only forIModuleAwareNameEnvironment.LookupStrategy.Named).- Specified by:
listPackagesin interfaceIModuleAwareNameEnvironment- Returns:
- array of flat, dot-separated package names
-
hasCompilationUnit
public boolean hasCompilationUnit(char[][] qualifiedPackageName, char[] moduleName, boolean checkCUs) Description copied from interface:IModuleAwareNameEnvironmentAnswer whether the given package (within the given module) contains any compilation unit.- Specified by:
hasCompilationUnitin interfaceIModuleAwareNameEnvironment- Parameters:
checkCUs- - if true, check contained Compilation Units for a matching package declaration- Returns:
- true iff the package contains at least one compilation unit.
-
getModule
Description copied from interface:IModuleAwareNameEnvironmentGet the module with the given name, which must denote a named module.- Specified by:
getModulein interfaceIModuleAwareNameEnvironment
-
getAllAutomaticModules
public char[][] getAllAutomaticModules()- Specified by:
getAllAutomaticModulesin interfaceIModuleAwareNameEnvironment
-
createWithReferencedProjects
public static INameEnvironment createWithReferencedProjects(IJavaProject javaProject, List<IJavaProject> referencedProjects, ICompilationUnit[] copies)
-