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()
InputFile
FileSystem
. 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 InputFile
relativePath
in interface InputPath
InputFile.relativePath()
,
InputDir.relativePath()
public String absolutePath()
InputFile
file().getCanonicalPath()
to resolve symbolic link.absolutePath
in interface InputFile
absolutePath
in interface InputPath
InputFile.absolutePath()
,
InputDir.absolutePath()
public File file()
InputFile
File
file
in interface InputFile
file
in interface InputPath
InputFile.file()
,
InputDir.file()
public Path path()
InputFile
Path
path
in interface InputFile
path
in interface InputPath
InputFile.path()
,
InputDir.path()
@CheckForNull public String language()
InputFile
public InputFile.Type type()
InputFile
public InputFile.Status status()
public int lines()
InputFile
public DefaultInputFile setModuleBaseDir(Path moduleBaseDir)
DefaultFileSystem
public 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.