public interface JCompilationUnit extends JNode
.java
source file).
Compilation unit elements need to be opened before they can be navigated.
The children are of type JPackage
, JImport
,
and JType
, and appear in the order in which they are declared in the source.
If a .java
file cannot be parsed, its structure remains unknown.Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHeader()
Returns the header comment for this compilation unit.
|
void |
setHeader(java.lang.String header)
Sets the header comment for this compilation unit.
|
getChildren, getContents, getFlags, getName, getParent, getQualifiedName, setFlags, setName
java.lang.String getHeader()
null
if
no header comment is presentvoid setHeader(java.lang.String header)
header
- the header comment for this compilation unit, or null
if
indicating no header comment