|
RECODER 0.92 | |||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectrecoder.kit.UnitKit
public class UnitKit
| Method Summary | |
|---|---|
static Import |
appendImport(ChangeHistory ch,
CompilationUnit cu,
ClassType ct)
Transformation that appends an import specification for the given class type. |
static Import |
appendImport(ChangeHistory ch,
CompilationUnit cu,
java.lang.String typeName)
Deprecated. should become a fully grown transformation. |
static void |
assertPartOf(ProgramElement pe,
java.util.List<CompilationUnit> cu)
Query that checks if pe is reachable in the AST of
CompilationUnit cu. |
static Import |
ensureImport(ChangeHistory ch,
SourceInfo si,
java.lang.String typeName,
ProgramElement context)
Deprecated. needs further testing - use at your own risks |
static void |
ensureImports(ChangeHistory ch,
SourceInfo si,
ProgramElement root)
Deprecated. needs further testing - use at your own risks |
static CompilationUnit |
getCompilationUnit(ProgramElement p)
Query that returns the compilation unit which the given program element is located in. |
static java.util.List<Import> |
getUnnecessaryImports(CrossReferenceSourceInfo xrsi,
CompilationUnit cu)
Query that finds all unnecessary import specifications in a compilation unit. |
static void |
normalizeImports(ChangeHistory ch,
CrossReferenceSourceInfo xrsi,
CompilationUnit cu,
boolean removeMultiTypeImports,
boolean removeSingleTypeImports,
boolean addJavaLangImports,
boolean addDefaultPackageImports)
Deprecated. should become a fully grown transformation. |
static void |
removeUnusedImports(ChangeHistory ch,
CrossReferenceSourceInfo xrsi,
CompilationUnit cu)
Deprecated. should become a first class transformation. |
static void |
sortImports(ChangeHistory ch,
CompilationUnit cu)
sort imports lexically and insert one blank line between different top level names !!!!!!!!!!!!!!!!!!!! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static CompilationUnit getCompilationUnit(ProgramElement p)
null, if the element is
null or not a part of a compilation unit. If the element is
already a compilation unit, the element is returned.
p - a program element.
null.
public static void assertPartOf(ProgramElement pe,
java.util.List<CompilationUnit> cu)
pe is reachable in the AST of
CompilationUnit cu. Useful, e.g., for debugging,
to ensure that links are set correctly during transformations.
p - cu -
public static java.util.List<Import> getUnnecessaryImports(CrossReferenceSourceInfo xrsi,
CompilationUnit cu)
xrsi - the cross reference source info to use.cu - the compilation unit to find unnecessary imports in.
public static void removeUnusedImports(ChangeHistory ch,
CrossReferenceSourceInfo xrsi,
CompilationUnit cu)
public static void normalizeImports(ChangeHistory ch,
CrossReferenceSourceInfo xrsi,
CompilationUnit cu,
boolean removeMultiTypeImports,
boolean removeSingleTypeImports,
boolean addJavaLangImports,
boolean addDefaultPackageImports)
public static Import appendImport(ChangeHistory ch,
CompilationUnit cu,
ClassType ct)
ch - the change history to notify (may be null).cu - the unit to create the import for.ct - the class type to create the import for.
public static Import appendImport(ChangeHistory ch,
CompilationUnit cu,
java.lang.String typeName)
ch - the change history to notify (may be null).cu - the unit to create the import for.typeName - the class type name to create the import for.
public static Import ensureImport(ChangeHistory ch,
SourceInfo si,
java.lang.String typeName,
ProgramElement context)
null is returned, otherwise the new import specification
that imports the type directly.
ch - the change history to report to (may be null).si - the source info service.typeName - the fully qualified name of the type to be known at the unit
level.context - the context in which the type should be known.
null if no new import was needed.
public static void ensureImports(ChangeHistory ch,
SourceInfo si,
ProgramElement root)
ch - the change history to report to (may be null).si - the source info service.root - the root element in a subtree containing type references to
check.
public static void sortImports(ChangeHistory ch,
CompilationUnit cu)
|
RECODER 0.92 | |||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||