|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.scan.filesystem.internal.DefaultInputFile
public class DefaultInputFile
PLUGINS MUST NOT USE THIS CLASS, EVEN FOR UNIT TESTING.
Field Summary | |
---|---|
static String |
ATTRIBUTE_COMPONENT_KEY
We're not sure that this is the correct way, so not in API yet. |
Fields inherited from interface org.sonar.api.scan.filesystem.internal.InputFile |
---|
ATTRIBUTE_HASH, ATTRIBUTE_LANGUAGE, ATTRIBUTE_SOURCE_RELATIVE_PATH, ATTRIBUTE_SOURCEDIR_PATH, ATTRIBUTE_STATUS, ATTRIBUTE_TYPE, STATUS_ADDED, STATUS_CHANGED, STATUS_SAME, TYPE_SOURCE, TYPE_TEST |
Method Summary | |
---|---|
String |
absolutePath()
Not-null canonical path. |
String |
attribute(String key)
See list of attribute keys in constants starting with ATTRIBUTE_. |
Map<String,String> |
attributes()
|
static DefaultInputFile |
create(File file,
String path,
Map<String,String> attributes)
Plugins must not build their own instances of InputFile . |
boolean |
equals(Object o)
|
File |
file()
|
boolean |
has(String attribute,
String value)
Does the given attribute have the given value ? |
int |
hashCode()
|
String |
name()
Not-null filename, including extension |
String |
path()
Path is relative from module base directory. |
String |
toString()
|
String |
type()
Not-null type (is it a source file or a unit test file?). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTE_COMPONENT_KEY
Method Detail |
---|
public static DefaultInputFile create(File file, String path, Map<String,String> attributes)
InputFile
.
ModuleFileSystem
must be used to search for files to scan.
Usage: InputFile.create(file, "src/main/java/com/Foo.java", attributes)
public String path()
InputFile
ModuleFileSystem
.
File separator is the forward slash ('/'), even on MSWindows.
Returns src/main/java/com/Foo.java
if module base dir is
/absolute/path/to/module
and if file is
/absolute/path/to/module/src/main/java/com/Foo.java
.
Returned path is never null.
path
in interface InputFile
public String absolutePath()
InputFile
absolutePath
in interface InputFile
public File file()
file
in interface InputFile
public String name()
InputFile
name
in interface InputFile
public String type()
InputFile
TYPE_
, for example InputFile.TYPE_SOURCE
.
type
in interface InputFile
public boolean has(String attribute, String value)
InputFile
has
in interface InputFile
@CheckForNull public String attribute(String key)
InputFile
attribute
in interface InputFile
public Map<String,String> attributes()
attributes
in interface InputFile
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |