org.sonar.api.batch.fs.internal
Class DefaultInputFile

java.lang.Object
  extended by org.sonar.api.batch.fs.internal.DefaultInputFile
All Implemented Interfaces:
Serializable, InputFile
Direct Known Subclasses:
DeprecatedDefaultInputFile

public class DefaultInputFile
extends Object
implements InputFile, Serializable

Since:
4.2
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sonar.api.batch.fs.InputFile
InputFile.Status, InputFile.Type
 
Constructor Summary
DefaultInputFile(String relativePath)
           
 
Method Summary
 String absolutePath()
          Marked as nullable just for the unit tests that do not call setFile(java.io.File) previously.
 boolean equals(Object o)
           
 File file()
          The underlying absolute File
 String hash()
          Digest hash of the file.
 int hashCode()
           
 String key()
          Component key.
 String language()
          Marked as nullable just for the unit tests that do not call setLanguage(String) previously.
 int lines()
          Number of physical lines.
 String relativePath()
          Path relative to module base directory.
 DefaultInputFile setAbsolutePath(String s)
           
 DefaultInputFile setFile(File file)
           
 DefaultInputFile setHash(String hash)
           
 DefaultInputFile setKey(String s)
           
 DefaultInputFile setLanguage(String language)
           
 DefaultInputFile setLines(int lines)
           
 DefaultInputFile setStatus(InputFile.Status status)
           
 DefaultInputFile setType(InputFile.Type type)
           
 InputFile.Status status()
          Marked as nullable just for the unit tests that do not previously call setStatus(org.sonar.api.batch.fs.InputFile.Status)
 String toString()
           
 InputFile.Type type()
          Does it contain main or test code ?
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultInputFile

public DefaultInputFile(String relativePath)
Method Detail

relativePath

public String relativePath()
Description copied from interface: InputFile
Path relative to module base directory. Path is unique and identifies file within given 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').

Specified by:
relativePath in interface InputFile

absolutePath

@CheckForNull
public String absolutePath()
Marked as nullable just for the unit tests that do not call setFile(java.io.File) previously.

Specified by:
absolutePath in interface InputFile

file

public File file()
Description copied from interface: InputFile
The underlying absolute File

Specified by:
file in interface InputFile

language

@CheckForNull
public String language()
Marked as nullable just for the unit tests that do not call setLanguage(String) previously.

Specified by:
language in interface InputFile

type

public InputFile.Type type()
Description copied from interface: InputFile
Does it contain main or test code ?

Specified by:
type in interface InputFile

status

@CheckForNull
public InputFile.Status status()
Marked as nullable just for the unit tests that do not previously call setStatus(org.sonar.api.batch.fs.InputFile.Status)

Specified by:
status in interface InputFile

hash

@CheckForNull
public String hash()
Digest hash of the file. Marked as nullable just for the unit tests that do not previously call setHash(String)


lines

public int lines()
Description copied from interface: InputFile
Number of physical lines. This method supports all end-of-line characters. Returns zero if the file is empty.

Specified by:
lines in interface InputFile

key

@CheckForNull
public String key()
Component key. It's marked as nullable just for the unit tests that do not previously call setKey(String).


setAbsolutePath

public DefaultInputFile setAbsolutePath(String s)

setLanguage

public DefaultInputFile setLanguage(String language)

setFile

public DefaultInputFile setFile(File file)

setType

public DefaultInputFile setType(InputFile.Type type)

setStatus

public DefaultInputFile setStatus(InputFile.Status status)

setHash

public DefaultInputFile setHash(String hash)

setLines

public DefaultInputFile setLines(int lines)

setKey

public DefaultInputFile setKey(String s)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2014 SonarSource. All Rights Reserved.