Method Summary |
|
void | addSourceCodeFragment(SourceCodeFragment fragment) Add a source code fragment to this compilation unit. |
int | beginOfLineIndex(int index) Helper method to get the begin index of the line that corresponds to the
given index. |
List<CtSimpleType<?>> | getDeclaredTypes() Gets all the types declared in this compilation unit. |
File | getFile() Gets the file that corresponds to this compilation unit if any (contains
the source code). |
CtSimpleType | getMainType() Searches and returns the main type (the type which has the same name as
the file). |
Set<Import> | getManualImports() Gets the imports to be forced by this compilation unit when the
auto-import is off. |
String | getOriginalSourceCode() Gets the original source code as a string. |
List<SourceCodeFragment> | getSourceCodeFraments() Gets the source code fragments for this compilation unit. |
int | getTabCount(int index) Gets the number of tabulations for a given line. |
boolean | isAutoImport() Tells if this compilation unit auto-import feature is on or off (default
is on). |
int | nextLineIndex(int index) Helper method to get the begin index of the line that corresponds to the
next line of the given index. |
void | setAutoImport(boolean autoImport) Sets this compilation unit auto-import feature on or off (default is on). |
void | setDeclaredTypes(List<CtSimpleType<?>> types) Sets the types declared in this compilation unit. |
void | setFile(File file) Sets the file that corresponds to this compilation unit. |
void | setManualImports(Set<Import> manualImports) Sets the imports to be forced by this compilation unit when the
auto-import is off. |