Package org.apache.maven.jxr.pacman
Class JavaFile
- java.lang.Object
-
- org.apache.maven.jxr.pacman.JavaFile
-
- Direct Known Subclasses:
JavaFileImpl
public abstract class JavaFile extends java.lang.ObjectInterface for objects which wish to provide meta-info about a JavaFile.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ClassType>classTypesprivate java.lang.Stringencodingprivate java.lang.Stringfilenameprivate java.util.Set<ImportType>importsprivate PackageTypepackageTypeprivate java.nio.file.Pathpath
-
Constructor Summary
Constructors Modifier Constructor Description protectedJavaFile(java.nio.file.Path path, java.lang.String encoding)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClassType(ClassType classType)Add a class type to the current list of class types.voidaddImportType(ImportType importType)Add an import type.ClassTypegetClassType()Gets the name of this class.java.util.List<ClassType>getClassTypes()Gets the names of the classes in this file.java.lang.StringgetEncoding()Gets the encoding attribute.java.lang.StringgetFilename()Gets the file name without path and extension.protected static java.lang.StringgetFilenameWithoutPathOrExtension(java.nio.file.Path path)Remove the path and the ".java" extension from a filename.java.util.Set<ImportType>getImportTypes()Gets the imported packages/files that this package has.PackageTypegetPackageType()Gets the package of this class.java.nio.file.PathgetPath()Gets the path attribute.voidsetClassType(ClassType classType)Sets the name of this class.voidsetPackageType(PackageType packageType)Sets the package type of this class.
-
-
-
Field Detail
-
imports
private java.util.Set<ImportType> imports
-
classTypes
private java.util.List<ClassType> classTypes
-
packageType
private PackageType packageType
-
path
private final java.nio.file.Path path
-
filename
private java.lang.String filename
-
encoding
private final java.lang.String encoding
-
-
Method Detail
-
getImportTypes
public java.util.Set<ImportType> getImportTypes()
Gets the imported packages/files that this package has.- Returns:
- import types
-
getClassType
public ClassType getClassType()
Gets the name of this class.- Returns:
- class type
-
getClassTypes
public java.util.List<ClassType> getClassTypes()
Gets the names of the classes in this file.- Returns:
- list of class types
-
getPackageType
public PackageType getPackageType()
Gets the package of this class.- Returns:
- package type
-
addClassType
public void addClassType(ClassType classType)
Add a class type to the current list of class types.- Parameters:
classType- class type
-
addImportType
public void addImportType(ImportType importType)
Add an import type.- Parameters:
importType- import type
-
setClassType
public void setClassType(ClassType classType)
Sets the name of this class.- Parameters:
classType- class type
-
setPackageType
public void setPackageType(PackageType packageType)
Sets the package type of this class.- Parameters:
packageType- package type
-
getPath
public java.nio.file.Path getPath()
Gets the path attribute.- Returns:
- path
-
getFilename
public java.lang.String getFilename()
Gets the file name without path and extension.- Returns:
- file name
-
getEncoding
public java.lang.String getEncoding()
Gets the encoding attribute.- Returns:
- encoding
-
getFilenameWithoutPathOrExtension
protected static java.lang.String getFilenameWithoutPathOrExtension(java.nio.file.Path path)
Remove the path and the ".java" extension from a filename.- Parameters:
path- path to modify- Returns:
- modified path
-
-