public abstract class JavaFile extends Object
Modifier | Constructor and Description |
---|---|
protected |
JavaFile(Path path,
String encoding) |
Modifier and Type | Method and Description |
---|---|
void |
addClassType(ClassType classType)
Add a class type to the current list of class types.
|
void |
addImportType(ImportType importType)
Add an import type.
|
ClassType |
getClassType()
Gets the name of this class.
|
List<ClassType> |
getClassTypes()
Gets the names of the classes in this file.
|
String |
getEncoding()
Gets the encoding attribute.
|
String |
getFilename()
Gets the file name without path and extension.
|
protected static String |
getFilenameWithoutPathOrExtension(Path path)
Remove the path and the ".java" extension from a filename.
|
Set<ImportType> |
getImportTypes()
Gets the imported packages/files that this package has.
|
PackageType |
getPackageType()
Gets the package of this class.
|
Path |
getPath()
Gets the path attribute.
|
void |
setClassType(ClassType classType)
Sets the name of this class.
|
void |
setPackageType(PackageType packageType)
Sets the package type of this class.
|
public Set<ImportType> getImportTypes()
public ClassType getClassType()
public List<ClassType> getClassTypes()
public PackageType getPackageType()
public void addClassType(ClassType classType)
classType
- class typepublic void addImportType(ImportType importType)
importType
- import typepublic void setClassType(ClassType classType)
classType
- class typepublic void setPackageType(PackageType packageType)
packageType
- package typepublic Path getPath()
public String getFilename()
public String getEncoding()
Copyright © 2002–2024 The Apache Software Foundation. All rights reserved.