IPackageCache Interface
- public interface IPackageCache
public static interface | IPackageCache.ITypeDefinition
ITypeDefinition defines a cached package to be a set of two values, a type name and a package name.
|
public static final Object |
-
CACHE_LOADED
- The cache is loaded and ready to go.
|
public static final Object |
-
CACHE_LOADING
- The cache is actively loading.
|
public static final Object |
-
CACHE_UNINITIALIZED
- The cache has not started loading.
|
public static final int |
-
WAIT_CLASSPATH_ONLY
- Flag to pass when getting an IPackageCache indicating you wish the call to block until classpath
information is loaded.
|
public static final int |
-
WAIT_NONE
- Flag to pass when getting an IPackageCache indicating you do not wish the call to block,
even if the package cache is not currently fully loaded.
|
public Object |
-
getCacheStatus (IProject proj)
- Returns the status of the package cache.
|
public List |
-
getMatchingQualifiedTypes (IProject proj, String qualifiedTypeName, boolean sourceOnly)
- Returns a list of all types with the specified fully-qualified name.
|
public List |
-
getMatchingTypes (IProject proj, String shortName, boolean sourceOnly, boolean prefixMatch, boolean matchCase)
- Returns an list of ITypeDefinition objects corresponding to all types matching the specified type name
within the specified IDE project.
|
public boolean |
-
isAmbiguous (IProject proj, String typeName, boolean sourceOnly)
- Returns whether there are multiple types that match the non-qualified type name.
|
CACHE_LOADED
public static final Object
CACHE_LOADED
- The cache is loaded and ready to go.
CACHE_LOADING
public static final Object
CACHE_LOADING
- The cache is actively loading. This process may take some time.
CACHE_UNINITIALIZED
public static final Object
CACHE_UNINITIALIZED
- The cache has not started loading.
WAIT_CLASSPATH_ONLY
public static final int WAIT_CLASSPATH_ONLY
- Flag to pass when getting an IPackageCache indicating you wish the call to block until classpath
information is loaded.
WAIT_NONE
public static final int WAIT_NONE
- Flag to pass when getting an IPackageCache indicating you do not wish the call to block,
even if the package cache is not currently fully loaded.
getCacheStatus(IProject) Method
public Object
getCacheStatus(IProject
proj)
Returns the status of the package cache. Attempts to access the cache before loading is complete will not
cause failures, but they will produce empty or incomplete results.
getMatchingQualifiedTypes(IProject, String, boolean) Method
public List
getMatchingQualifiedTypes(IProject
proj,
String
qualifiedTypeName,
boolean sourceOnly)
Returns a list of all types with the specified fully-qualified name. Except in the case of type
shadowing, this list should contain zero or one entry(s).
Parameters
-
proj
- The project in which to look for the type.
-
qualifiedTypeName
- The fully-qualified name of the type in question.
-
sourceOnly
- Whether non-source classes should be considered. If true, only those classes
defined in the specified project's source path will be serached. If false, the project's
classpath will be searched as well.
Returns
- List of all types matching the requested fully-qualified type name.
getMatchingTypes(IProject, String, boolean, boolean, boolean) Method
public List
getMatchingTypes(IProject
proj,
String
shortName,
boolean sourceOnly,
boolean prefixMatch,
boolean matchCase)
Returns an list of ITypeDefinition objects corresponding to all types matching the specified type name
within the specified IDE project. In the case of type name "List", at least two type definitions will
be returned: "java.util.List", and "java.awt.List". Note that only public types will be returned;
package private type definitions are ignored.
Parameters
-
proj
- The IDE project in which to look for matching types.
-
shortName
- The short name of the desired type
-
sourceOnly
- Whether non-source classes should be considered. If true, only those classes
defined in the specified project's source path will be serached. If false, the project's
classpath will be searched as well.
-
prefixMatch
- If true, all types with names beginning with the specified type name will be returned.
-
matchCase
- Indicates whether a case-sensitive check should be used to determine matching types.
isAmbiguous(IProject, String, boolean) Method
public boolean isAmbiguous(IProject
proj,
String
typeName,
boolean sourceOnly)
Returns whether there are multiple types that match the non-qualified type name. This method is generally
used to determine if a given type should be presented to the user in simple or fully-qualified format.
Parameters
-
proj
- The project in which to look for the type.
-
typeName
- The qualified or non-qualified name of the type in question.
-
sourceOnly
- Whether non-source classes should be considered. If true, only those classes
defined in the specified project's source path will be serached. If false, the project's
classpath will be searched as well.
Returns
- boolean indicating whether the simple name of the specified type is ambiguous within the project.