com.atlassian.clover.api.registry

## Interface FileInfo

- All Superinterfaces:
    EntityContainer, HasClasses, HasContextFilter, HasMethods, HasMetrics, HasParent, HasStatements, InstrumentationInfo, SourceInfo

      public interface FileInfo
      extends InstrumentationInfo, SourceInfo, EntityContainer, HasClasses, HasMethods, HasStatements, HasContextFilter, HasMetrics, HasParent

  Represents a single source file. A file is a part of a package - `getContainingPackage()` Implemented interfaces:
  - InstrumentationInfo - data index range for the whole file
  - SourceInfo - represents content of the whole file
  - HasClasses, HasMethods, HasStatements - code entities which can be declared in the file (on the lop level)
  - HasContextFilter - set of custom statement/method contexts for filtering
  - HasMetrics - code metrics for the file
  - HasParent - parent package for this file

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getChecksum()`
    `java.util.List<? extends ClassInfo>` | `getClasses()` Returns list of classes which are declared on a top-level of this source file (i.e.
    `PackageInfo` | `getContainingPackage()` Returns a package for which this package belongs to (or the default package) Note: it supports only one package namespace per source file
    `java.lang.String` | `getEncoding()` Returns file encoding, e.g.
    `long` | `getFilesize()` Returns file size in bytes
    `int` | `getLineCount()` Returns number of source lines in a file
    `java.util.List<? extends MethodInfo>` | `getMethods()` Returns list of methods which are declared on a top-level of this source file.
    `java.lang.String` | `getName()` Returns source file name
    `int` | `getNcLineCount()` Returns number of non-comment and non-empty source lines in a file.
    `java.lang.String` | `getPackagePath()` Returns a file name with a package path, e.g.
    `java.util.List<? extends StatementInfo>` | `getStatements()` Returns list of statements which are declared on a top-level of this source file.
    `long` | `getTimestamp()` Returns file modification time stamp as per File.lastModified()
    `boolean` | `isEmpty()` Returns true if the file does not contain any inner code entities.
    `boolean` | `isTestFile()` Returns true if this is a test file (according to the test pattern defined during instrumentation)

    - ### Methods inherited from interface com.atlassian.clover.api.registry.InstrumentationInfo

      `getDataIndex, getDataLength`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.SourceInfo

      `getEndColumn, getEndLine, getStartColumn, getStartLine`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.EntityContainer

      `visit`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.HasClasses

      `getAllClasses`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.HasMethods

      `getAllMethods`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.HasContextFilter

      `getContextFilter`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.HasMetrics

      `getMetrics, getRawMetrics, setMetrics`

    - ### Methods inherited from interface com.atlassian.clover.api.registry.HasParent

      `getParent`

- - ### Method Detail

    - #### getClasses

          @NotNull
          java.util.List<? extends ClassInfo> getClasses()

      Returns list of classes which are declared on a top-level of this source file (i.e. it does not return inner classes). Exact content may depend on the programming language, e.g.:
      - Java, Groovy - classes and interfaces
      - Scala - classes, objects, traits
      Specified by:
        `getClasses` in interface `HasClasses`
      Returns:
        List<? extends ClassInfo> - list of classes or empty list if none

    - #### getMethods

          @NotNull
          java.util.List<? extends MethodInfo> getMethods()

      Returns list of methods which are declared on a top-level of this source file. Exact content may depend on the programming language, e.g.:
      - Java - not applicable
      - Groovy - methods declared outside a class (in a groovy script)
      - Scala - functions declared outside a class
      Specified by:
        `getMethods` in interface `HasMethods`
      Returns:
        List<? extends MethodInfo> - list of methods or empty list if none

    - #### getStatements

          @NotNull
          java.util.List<? extends StatementInfo> getStatements()

      Returns list of statements which are declared on a top-level of this source file. Exact content may depend on the programming language, e.g.:
      - Java - not applicable (it's not possible to write statements outside a class)
      - Groovy - methods declared outside a class (in a groovy script)
      - Scala - functions declared outside a class
      Specified by:
        `getStatements` in interface `HasStatements`
      Returns:
        List<? extends MethodInfo> - list of methods or empty list if none

    - #### getName

          java.lang.String getName()

      Returns source file name
      Specified by:
        `getName` in interface `HasMetrics`
      Returns:
        String

    - #### getEncoding

          java.lang.String getEncoding()

      Returns file encoding, e.g. "UTF-8"
      Returns:
        String

    - #### getTimestamp

          long getTimestamp()

      Returns file modification time stamp as per File.lastModified()
      Returns:
        long time stamp

    - #### getFilesize

          long getFilesize()

      Returns file size in bytes
      Returns:
        long size

    - #### getChecksum

          long getChecksum()

    - #### getPackagePath

          java.lang.String getPackagePath()

      Returns a file name with a package path, e.g. "com/acme/Foo.java" Note: it supports only one package namespace per source file
      Returns:
        String package path

    - #### getContainingPackage

          PackageInfo getContainingPackage()

      Returns a package for which this package belongs to (or the default package) Note: it supports only one package namespace per source file
      Returns:
        PackageInfo

    - #### getLineCount

          int getLineCount()

      Returns number of source lines in a file
      Returns:
        int

    - #### getNcLineCount

          int getNcLineCount()

      Returns number of non-comment and non-empty source lines in a file.
      Returns:
        int

    - #### isEmpty

          boolean isEmpty()

      Returns true if the file does not contain any inner code entities.
      Returns:
        boolean - true if getClasses() is empty

    - #### isTestFile

          boolean isTestFile()

      Returns true if this is a test file (according to the test pattern defined during instrumentation)
      Returns:
        boolean - true if it's a test file, false otherwise