public class DefaultInputFile extends Object implements InputFile
InputFile.Status, InputFile.Type| Modifier and Type | Field and Description |
|---|---|
protected Path |
moduleBaseDir |
| Constructor and Description |
|---|
DefaultInputFile(String moduleKey,
String relativePath) |
| Modifier and Type | Method and Description |
|---|---|
String |
absolutePath()
Normalized absolute path.
|
Charset |
charset() |
boolean |
equals(Object o) |
File |
file()
The underlying absolute
File |
int |
hashCode() |
String |
key()
Component key.
|
String |
language()
Language, for example "java" or "php".
|
int |
lastValidOffset() |
int |
lines()
Number of physical lines.
|
String |
moduleKey() |
Path |
path()
The underlying absolute
Path |
String |
relativePath()
Path relative to module base directory.
|
DefaultInputFile |
setCharset(Charset charset) |
DefaultInputFile |
setLanguage(String language) |
DefaultInputFile |
setLastValidOffset(int lastValidOffset) |
DefaultInputFile |
setLines(int lines) |
DefaultInputFile |
setModuleBaseDir(Path moduleBaseDir)
For testing purpose.
|
DefaultInputFile |
setStatus(InputFile.Status status) |
DefaultInputFile |
setType(InputFile.Type type) |
InputFile.Status |
status()
|
String |
toString() |
InputFile.Type |
type()
Does it contain main or test code ?
|
protected Path moduleBaseDir
public DefaultInputFile(String moduleKey, String relativePath)
public String relativePath()
InputFileFileSystem. File separator is the forward
slash ('/'), even on Microsoft Windows.
Returns src/main/java/com/Foo.java if module base dir is
/path/to/module and if file is
/path/to/module/src/main/java/com/Foo.java.
Relative path is not null and is normalized ('foo/../foo' is replaced by 'foo').relativePath in interface InputFilerelativePath in interface InputPathInputFile.relativePath(),
InputDir.relativePath()public String absolutePath()
InputFilefile().getCanonicalPath() to resolve symbolic link.absolutePath in interface InputFileabsolutePath in interface InputPathInputFile.absolutePath(),
InputDir.absolutePath()public File file()
InputFileFilefile in interface InputFilefile in interface InputPathInputFile.file(),
InputDir.file()public Path path()
InputFilePathpath in interface InputFilepath in interface InputPathInputFile.path(),
InputDir.path()@CheckForNull public String language()
InputFilepublic InputFile.Type type()
InputFilepublic InputFile.Status status()
public int lines()
InputFilepublic DefaultInputFile setModuleBaseDir(Path moduleBaseDir)
DefaultFileSystempublic DefaultInputFile setLanguage(@Nullable String language)
public DefaultInputFile setType(InputFile.Type type)
public DefaultInputFile setStatus(InputFile.Status status)
public DefaultInputFile setLines(int lines)
public DefaultInputFile setCharset(Charset charset)
public int lastValidOffset()
public DefaultInputFile setLastValidOffset(int lastValidOffset)
Copyright © 2009–2015 SonarSource. All rights reserved.