java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportRewriteAnalyzer

public final class ImportRewriteAnalyzer extends Object
Allows the caller to specify imports to be added to or removed from a compilation unit and creates a TextEdit which, applied to the compilation unit, effects the specified additions and removals.

Operates in either of two modes (selected via ImportRewriteConfiguration.Builder's static factory methods):

  • Discarding original imports and totally sorting all imports added thereafter. This mode is used by the Organize Imports operation.
  • Preserving original imports and placing each added import adjacent to the one most closely matching it. This mode is used e.g. when Content Assist adds an import for a completed name.