Interface ICCSource

All Known Subinterfaces:
ICCFile, ICCFlowPoint, ICCImportFile, ICCImportFlowPoint

public interface ICCSource
Implementors of this interface declare that they support source in some form It may be source or listing depending on the origin of the code coverage data
Since:
4.1
Do not implement:
This interface is not intended to be implemented by clients.
  • Field Details

  • Method Details

    • isSourceAvailable

      boolean isSourceAvailable()
      Returns:
      true if source is available
    • getFile

      File getFile()
      Returns:
      the file if it exists
    • getFile

      File getFile(boolean unzip)
      Parameters:
      unzip - if true the file will be unzipped if it is in a zip file
      Returns:
      the unzipped file
      Since:
      5.0
    • getStream

      InputStream getStream() throws IOException
      Returns:
      inputStream to the contents
      Throws:
      IOException - exception if there is a problem getting the stream
    • getStream

      InputStream getStream(boolean includeMarkers) throws IOException
      Parameters:
      includeMarkers - if true then code coverage markers are inserted into each line
      Returns:
      stream with contents and optionally inserted cc markers
      Throws:
      IOException - if there is a problem getting the stream
      Since:
      10.0
    • getEncoding

      String getEncoding()
      Returns:
      file encoding
      Since:
      7.0
    • getLine

      int getLine()
      Return the logical first line number in the source/listing
      Returns:
      line number in source for start of this artifact
    • getFileName

      String getFileName()
      Returns a name for this item
      Returns:
      file name
    • getLanguage

      int getLanguage()
      Returns:
      programming language
    • updateFile

      void updateFile(File file)
      Updates or overwrites the source file Used after an import that didn't find source to update with found source Calls to isSourceAvailable() will return true after a file is set Calls to isExternal() will return true indicating that the file exists outside the results
      Parameters:
      file - to use with this source
      Since:
      5.0
    • setSourceAvailable

      void setSourceAvailable(boolean available)
      Sets source available to passed boolean
      Parameters:
      available - update source available
    • setProperty

      void setProperty(String key, Object value)
      Parameters:
      key - property key
      value - property value
    • getProperty

      Object getProperty(String key)
      Parameters:
      key - property key
      Returns:
      property object or null
    • isExternal

      boolean isExternal()
      Returns true if the source is NOT stored with the data, i.e. external to the data Returns false if the source is not available isSourceAvailable() or the source is stored with the data
      Returns:
      true if the source is stored external or separate from the data
      Since:
      5.0
    • getResult

      ICCResult getResult()
      Returns the ICCResult that contains this artifact
      Returns:
      result that contains this artifact
      Since:
      7.0