Class ClasspathFixProcessor


  • public abstract class ClasspathFixProcessor
    extends Object
    Class to be implemented by contributors to the extension point org.eclipse.jdt.ui.classpathFixProcessors.
    Since:
    3.4
    • Constructor Detail

      • ClasspathFixProcessor

        public ClasspathFixProcessor()
    • Method Detail

      • getFixImportProposals

        public abstract ClasspathFixProcessor.ClasspathFixProposal[] getFixImportProposals​(IJavaProject project,
                                                                                           String name)
                                                                                    throws CoreException
        Returns proposal that can fix non-resolvable imports. The proposal is expected to change the class path or a classpath container so that the missing type can be resolved. A proposal should also consider to fix related types. For example, when a reference to junit.framework.TestCase is requested, it makes sense to import the full JUnit library, not just fixing the missing type.
        Parameters:
        project - the current project
        name - the missing type to be added to the class path. The entries can be either a
        • qualified type name, like 'junit.framework.Test'
        • simple type name, like 'TestCase'
        • on demand import name, like 'org.junit.*'
        Returns:
        returns proposals to fix the class path so that the missing types are found. If no proposals can be offered, either null or the empty array can be returned. If null is returned, also the processors overridden by this processor are asked. If a non null result is returned, all overridden processors are skipped.
        Throws:
        CoreException - thrown when the creation of the proposals fails
      • getContributedFixImportProposals

        public static ClasspathFixProcessor.ClasspathFixProposal[] getContributedFixImportProposals​(IJavaProject project,
                                                                                                    String name,
                                                                                                    MultiStatus status)
        Evaluates all contributed proposals that can fix non-resolvable imports.
        Parameters:
        project - the current project
        name - the missing type to be added to the class path. The entries can be either a
        • qualified type name, like 'junit.framework.Test'
        • simple type name, like 'TestCase'
        • on demand import name, like 'org.junit.*'
        status - a MultiStatus to collect the resulting status or null to not collect status.
        Returns:
        returns proposals to fix the class path so that the missing types are found.