org.sonar.api.scan.filesystem.internal
Interface InputFile

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultInputFile

public interface InputFile
extends Serializable


Field Summary
static String ATTRIBUTE_HASH
           
static String ATTRIBUTE_LANGUAGE
          Detected language
static String ATTRIBUTE_SOURCE_RELATIVE_PATH
          Relative path from source directory.
static String ATTRIBUTE_SOURCEDIR_PATH
          Canonical path of source directory.
static String ATTRIBUTE_STATUS
           
static String ATTRIBUTE_TYPE
           
static String STATUS_ADDED
           
static String STATUS_CHANGED
           
static String STATUS_SAME
           
static String TYPE_SOURCE
           
static String 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()
           
 File file()
           
 boolean has(String attribute, String value)
          Does the given attribute have the given value ?
 String name()
          Not-null filename, including extension
 String path()
          Path is relative from module base directory.
 String type()
          Not-null type (is it a source file or a unit test file?).
 

Field Detail

ATTRIBUTE_SOURCEDIR_PATH

static final String ATTRIBUTE_SOURCEDIR_PATH
Canonical path of source directory. Example: /path/to/module/src/main/java or C:\path\to\module\src\main\java

See Also:
Constant Field Values

ATTRIBUTE_SOURCE_RELATIVE_PATH

static final String ATTRIBUTE_SOURCE_RELATIVE_PATH
Relative path from source directory. File separator is the forward slash ('/'), even on MSWindows.

See Also:
Constant Field Values

ATTRIBUTE_LANGUAGE

static final String ATTRIBUTE_LANGUAGE
Detected language

See Also:
Constant Field Values

ATTRIBUTE_TYPE

static final String ATTRIBUTE_TYPE
See Also:
Constant Field Values

TYPE_SOURCE

static final String TYPE_SOURCE
See Also:
Constant Field Values

TYPE_TEST

static final String TYPE_TEST
See Also:
Constant Field Values

ATTRIBUTE_STATUS

static final String ATTRIBUTE_STATUS
See Also:
Constant Field Values

STATUS_SAME

static final String STATUS_SAME
See Also:
Constant Field Values

STATUS_CHANGED

static final String STATUS_CHANGED
See Also:
Constant Field Values

STATUS_ADDED

static final String STATUS_ADDED
See Also:
Constant Field Values

ATTRIBUTE_HASH

static final String ATTRIBUTE_HASH
See Also:
Constant Field Values
Method Detail

path

String path()
Path is relative from module base directory. Path is unique and identifies file within given 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.


absolutePath

String absolutePath()
Not-null canonical path. File separator is forward slash ('/'), even on MSWindows.


file

File file()

name

String name()
Not-null filename, including extension


type

String type()
Not-null type (is it a source file or a unit test file?). See constant values prefixed by TYPE_, for example TYPE_SOURCE.


has

boolean has(String attribute,
            String value)
Does the given attribute have the given value ?


attribute

@CheckForNull
String attribute(String key)
See list of attribute keys in constants starting with ATTRIBUTE_.


attributes

Map<String,String> attributes()


Copyright © 2009-2014 SonarSource. All Rights Reserved.