Example usage for Java org.eclipse.jdt.core.dom.rewrite ImportRewrite fields, constructors, methods, implement or subclass
The text is from its open source code.
String | addImport(ITypeBinding binding) Adds a new import to the rewriter's record and returns a type reference that can be used in the code. |
String | addImport(String qualifiedTypeName) Adds a new import to the rewriter's record and returns a type reference that can be used in the code. |
String | addImport(ITypeBinding binding, ImportRewriteContext context) Adds a new import to the rewriter's record and returns a type reference that can be used in the code. |
Type | addImport(ITypeBinding binding, AST ast) Adds a new import to the rewriter's record and returns a Type that can be used in the code. |
String | addImport(String qualifiedTypeName, ImportRewriteContext context) Adds a new import to the rewriter's record and returns a type reference that can be used in the code. |
Type | addImportFromSignature(String typeSig, AST ast) Adds a new import to the rewriter's record and returns a Type node that can be used in the code as a reference to the type. |
String | addStaticImport(IBinding binding) Adds a new static import to the rewriter's record and returns a name - single member name if import is successful, else qualified name. |
ImportRewrite | create(ICompilationUnit cu, boolean restoreExistingImports) Creates an ImportRewrite from an ICompilationUnit . |
ImportRewrite | create(CompilationUnit astRoot, boolean restoreExistingImports) Creates an ImportRewrite from an AST ( CompilationUnit ). |
String[] | getAddedImports() Returns all non-static imports that are recorded to be added. |
String[] | getAddedStaticImports() Returns all static imports that are recorded to be added. |
ICompilationUnit | getCompilationUnit() The compilation unit for which this import rewrite was created for. |
String[] | getCreatedImports() Returns all new non-static imports created by the last invocation of #rewriteImports(IProgressMonitor) or null if these methods have not been called yet. |
String[] | getCreatedStaticImports() Returns all new static imports created by the last invocation of #rewriteImports(IProgressMonitor) or null if these methods have not been called yet. |
boolean | hasRecordedChanges() Returns true if imports have been recorded to be added or removed. |
boolean | removeImport(String qualifiedName) Records to remove a import. |
TextEdit | rewriteImports(IProgressMonitor monitor) Converts all modifications recorded by this rewriter into an object representing the corresponding text edits to the source code of the rewrite's compilation unit. |
void | setImportOrder(String[] order) Defines the import groups and order to be used by the ImportRewrite . |
void | setOnDemandImportThreshold(int threshold) Sets the on-demand import threshold for normal (non-static) imports. |
void | setStaticOnDemandImportThreshold(int threshold) Sets the on-demand import threshold for static imports. |
void | setUseContextToFilterImplicitImports(boolean useContextToFilterImplicitImports) Sets whether a context should be used to properly filter implicit imports. |