Klasse SearchableEnvironment

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.SearchableEnvironment
Alle implementierten Schnittstellen:
IJavaSearchConstants, IModuleAwareNameEnvironment, INameEnvironment
Bekannte direkte Unterklassen:
CancelableNameEnvironment

public class SearchableEnvironment extends Object implements IModuleAwareNameEnvironment, IJavaSearchConstants
This class provides a SearchableBuilderEnvironment for code assist which uses the Java model as a search tool.
  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • find

      protected NameEnvironmentAnswer find(String typeName, String packageName, IPackageFragmentRoot[] moduleContext)
      Returns the given type in the the given package if it exists, otherwise null.
    • findModules

      public void findModules(char[] prefix, ISearchRequestor requestor, IJavaProject javaProject)
      Find the modules that start with the given prefix. A valid prefix is a qualified name separated by periods (ex. java.util). The packages found are passed to: ISearchRequestor.acceptModule(char[][] moduleName)
    • findPackages

      public void findPackages(char[] prefix, ISearchRequestor requestor)
      Find the packages that start with the given prefix. A valid prefix is a qualified name separated by periods (ex. java.util). The packages found are passed to: ISearchRequestor.acceptPackage(char[][] packageName)
    • findPackages

      public void findPackages(char[] prefix, ISearchRequestor requestor, IPackageFragmentRoot[] moduleContext, boolean followRequires)
      Find the packages that start with the given prefix and belong to the given module. A valid prefix is a qualified name separated by periods (ex. java.util). The packages found are passed to: ISearchRequestor.acceptPackage(char[][] packageName)
    • findExactTypes

      public void findExactTypes(char[] name, boolean findMembers, int searchFor, ISearchRequestor storage)
      Find the top-level types that are defined in the current environment and whose simple name matches the given name. The types found are passed to one of the following methods (if additional information is known about the types): ISearchRequestor.acceptType(char[][] packageName, char[] typeName) ISearchRequestor.acceptClass(char[][] packageName, char[] typeName, int modifiers) ISearchRequestor.acceptInterface(char[][] packageName, char[] typeName, int modifiers) This method can not be used to find member types... member types are found relative to their enclosing type.
    • findTypeInModules

      public NameEnvironmentAnswer findTypeInModules(char[][] compoundTypeName, ModuleBinding module)
      Find a type in the given module or any module read by it. Does not check accessibility / unique visibility, but returns the first observable type found.
      Parameter:
      compoundTypeName - name of the sought type
      module - start into the module graph
      Gibt zurück:
      the answer :)
    • findType

      public NameEnvironmentAnswer findType(char[][] compoundTypeName, char[] moduleName)
      Angegeben von:
      findType in Schnittstelle IModuleAwareNameEnvironment
      Siehe auch:
    • findType

      public NameEnvironmentAnswer findType(char[] name, char[][] packageName, char[] moduleName)
      Beschreibung aus Schnittstelle kopiert: IModuleAwareNameEnvironment
      Answer a type identified by the given names. moduleName may be one of the special names from ModuleBinding (ANY, ANY_NAMED, UNNAMED).
      Angegeben von:
      findType in Schnittstelle IModuleAwareNameEnvironment
      Siehe auch:
    • findTypes

      public void findTypes(char[] prefix, boolean findMembers, boolean camelCaseMatch, int searchFor, ISearchRequestor storage)
      Find the top-level types that are defined in the current environment and whose name starts with the given prefix. The prefix is a qualified name separated by periods or a simple name (ex. java.util.V or V). The types found are passed to one of the following methods (if additional information is known about the types): ISearchRequestor.acceptType(char[][] packageName, char[] typeName) ISearchRequestor.acceptClass(char[][] packageName, char[] typeName, int modifiers) ISearchRequestor.acceptInterface(char[][] packageName, char[] typeName, int modifiers) This method can not be used to find member types... member types are found relative to their enclosing type.
    • findTypes

      public void findTypes(char[] prefix, boolean findMembers, int matchRule, int searchFor, ISearchRequestor storage, org.eclipse.core.runtime.IProgressMonitor monitor)
      Must be used only by CompletionEngine. The progress monitor is used to be able to cancel completion operations Find the top-level types that are defined in the current environment and whose name starts with the given prefix. The prefix is a qualified name separated by periods or a simple name (ex. java.util.V or V). The types found are passed to one of the following methods (if additional information is known about the types): ISearchRequestor.acceptType(char[][] packageName, char[] typeName) ISearchRequestor.acceptClass(char[][] packageName, char[] typeName, int modifiers) ISearchRequestor.acceptInterface(char[][] packageName, char[] typeName, int modifiers) This method can not be used to find member types... member types are found relative to their enclosing type.
    • findTypes

      public void findTypes(char[] prefix, boolean findMembers, int matchRule, int searchFor, boolean resolveDocumentName, ISearchRequestor storage, org.eclipse.core.runtime.IProgressMonitor monitor)
      Must be used only by CompletionEngine. The progress monitor is used to be able to cancel completion operations Find the top-level types that are defined in the current environment and whose name starts with the given prefix. The prefix is a qualified name separated by periods or a simple name (ex. java.util.V or V). The types found are passed to one of the following methods (if additional information is known about the types): ISearchRequestor.acceptType(char[][] packageName, char[] typeName) ISearchRequestor.acceptClass(char[][] packageName, char[] typeName, int modifiers) ISearchRequestor.acceptInterface(char[][] packageName, char[] typeName, int modifiers) This method can not be used to find member types... member types are found relative to their enclosing type.
    • findConstructorDeclarations

      public void findConstructorDeclarations(char[] prefix, int matchRule, boolean resolveDocumentName, ISearchRequestor storage, org.eclipse.core.runtime.IProgressMonitor monitor)
      Must be used only by CompletionEngine. The progress monitor is used to be able to cancel completion operations Find constructor declarations that are defined in the current environment and whose name starts with the given prefix. The prefix is a qualified name separated by periods or a simple name (ex. java.util.V or V). The constructors found are passed to one of the following methods: ISearchRequestor.acceptConstructor(...)
    • getModulesDeclaringPackage

      public char[][] getModulesDeclaringPackage(char[][] packageName, char[] moduleName)
      Angegeben von:
      getModulesDeclaringPackage in Schnittstelle IModuleAwareNameEnvironment
      Siehe auch:
    • hasCompilationUnit

      public boolean hasCompilationUnit(char[][] pkgName, char[] moduleName, boolean checkCUs)
      Beschreibung aus Schnittstelle kopiert: IModuleAwareNameEnvironment
      Answer whether the given package (within the given module) contains any compilation unit.
      Angegeben von:
      hasCompilationUnit in Schnittstelle IModuleAwareNameEnvironment
      Parameter:
      checkCUs - - if true, check contained Compilation Units for a matching package declaration
      Gibt zurück:
      true iff the package contains at least one compilation unit.
    • toStringChar

      protected String toStringChar(char[] name)
      Returns a printable string for the array.
    • toStringCharChar

      protected String toStringCharChar(char[][] names)
      Returns a printable string for the array.
    • cleanup

      public void cleanup()
      Beschreibung aus Schnittstelle kopiert: INameEnvironment
      This 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.
      Angegeben von:
      cleanup in Schnittstelle INameEnvironment
    • getModule

      public IModule getModule(char[] name)
      Beschreibung aus Schnittstelle kopiert: IModuleAwareNameEnvironment
      Get the module with the given name, which must denote a named module.
      Angegeben von:
      getModule in Schnittstelle IModuleAwareNameEnvironment
    • getAllAutomaticModules

      public char[][] getAllAutomaticModules()
      Angegeben von:
      getAllAutomaticModules in Schnittstelle IModuleAwareNameEnvironment
    • applyModuleUpdates

      public void applyModuleUpdates(IUpdatableModule module, IUpdatableModule.UpdateKind kind)
      Beschreibung aus Schnittstelle kopiert: IModuleAwareNameEnvironment
      Ask the name environment to perform any updates (add-exports or add-reads) to the given module.
      Angegeben von:
      applyModuleUpdates in Schnittstelle IModuleAwareNameEnvironment
      Parameter:
      module - the compiler representation of the module to updates
      kind - selects what kind of updates should be performed
    • getOwnedPackageFragmentRoots

      public static IPackageFragmentRoot[] getOwnedPackageFragmentRoots(IJavaProject javaProject) throws JavaModelException
      Löst aus:
      JavaModelException
    • listPackages

      public char[][] listPackages(char[] moduleName)
      Beschreibung aus Schnittstelle kopiert: IModuleAwareNameEnvironment
      Lists all packages in the module identified by the given, real module name (i.e., this method is implemented only for IModuleAwareNameEnvironment.LookupStrategy.Named).
      Angegeben von:
      listPackages in Schnittstelle IModuleAwareNameEnvironment
      Gibt zurück:
      array of flat, dot-separated package names
    • printTimeSpent

      public void printTimeSpent()