Interface ICCFile
- All Superinterfaces:
Comparable<ICCFile>,ICCBase,ICCCoverageData,ICCCoverageDataBasic,ICCPercentItem,ICCSource,ICCStatementData,ICCStatementDataBasic,ICCTreeItem
- All Known Subinterfaces:
ICCImportFile
New behavior in v9
The order that flowpoints are returned has been changed from undefined to ordered by the flowpoint's first line. This means that flowpoints will be returned in the order that they appear in the file. This also affects the
ICCTreeItem.getChildren().- Since:
- 3.1
-
Field Summary
Fields inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCCoverageDataBasic
EMPTYTESTCASESFields inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCSource
SOURCE_OBJECT -
Method Summary
Modifier and TypeMethodDescriptionReturns the file name without any path information.Returns a "normalized" or "common" name for the file that can be used to compare.Return the encoding of the stream or file returned by the implementer of this interface SeeCharsetfor a suggested list of possible encodingsgetFile()Returns a local file if available.getFile(boolean unzip) Same asgetFile()but can override the automatic unzip option.getFlowPoint(int id) Returns the ICCFlowPoint with the matching ID or nullgetFlowPoint(String name) Returns the first flow point with the given name When there is a flowpoint hierarchy, this will only return the first entry in the hierarchy that is found to match the name.getFlowPointByQualifiedName(String qualifiedName) Returns the first flow point with the given qualified name, using / as a separatorReturns a flat list of flowpoints.getFlowPoints(String name) Return zero of more flowpoints that match the name.intReturn an int that represents the compiled language of the file Refer toICCConstantsfor possible valuesICCPart[]getParts()Returns 0 or more artifacts that were created as a result of processing this file e.g.The list of root (ie have no parents) flowpoints.
Flowpoints are obtained during collection and may not represent a complete list as it appears in the source Debug technology and compiler optimization may not expose all the functions for some languages In v9 this list will be sorted by the flowpoint's first line numberbyte[]Returns an array of bytes that represent a unique signature for this file's contents The implementation guarantees that the signature from files that have the exact same content will match This can be used to compare with another file to make sure it is the same.Returns the source directory.Returns a path to the zip that contains the source This can be used when the caller wants to extract and manage the contentsReturns an input stream to the contents if it is available.getStream(boolean includeMarkers) Same asgetStream()but can return the input stream with code coverage indicators injected.booleanisNameMatch(String fileName) Indicates whether or not the specified file name matches the name for this file.booleanReturns true if the contents of this file are availablegetFile()can be used to get at the contents from the file systemgetStream()can be used to get the contents from both the file system or from a zipMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCBase
addEncodedMessage, addMessage, addMessage, getDecodedMessages, getDecodedMessages, getID, getMessages, getName, getProperties, getProperty, getProperty, isMessage, isProperty, setName, setProperty, updatePropertyMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCCoverageData
getHitLines, getLines, getTestcases, isHit, removeTestcaseMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCCoverageDataBasic
getNumExecutableLines, getNumFlowPoints, getNumHitFlowPoints, getNumHitLines, getTestcases, isHitMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCPercentItem
getPercentCoverageMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCSource
getFileName, getLine, getProperty, getResult, isExternal, setProperty, setSourceAvailable, updateFileMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCStatementData
getHitStatements, getLastStatement, getStatement, getStatement, getStatements, getStatements, getTestcases, isHitMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCStatementDataBasic
getNumExecutableStatements, getNumHitStatements, hasStatementsMethods inherited from interface com.ibm.debug.pdt.codecoverage.core.results.ICCTreeItem
addChild, addChildren, getChild, getChildren, getNumChildren, getParent, getQualifiedName, getUniqueID, getUUID, isRoot, refresh, setParent, setUUID, supportsUUID
-
Method Details
-
getBaseName
String getBaseName()Returns a "normalized" or "common" name for the file that can be used to compare. The name has information that can change during build from the name allowing for comparisons.NOTE: This may be the same as the base name
ICCBase.getName().- Returns:
- the common name of the file
-
getBaseFileName
String getBaseFileName()Returns the file name without any path information.- Returns:
- unqualified file name - no path information
- Since:
- 4.0
-
getFile
File getFile()Returns a local file if available. If null is returned usegetStream()when the contents are in a zip or remote system. If @seeICCResult.setUnZipOptions(String)is set then the zipped file will automatically be unzipped and returned. UsegetFile(boolean)if you need to override the automatic unzip option. UsegetEncoding()to get the encoding of the file's contents. -
getFile
Same asgetFile()but can override the automatic unzip option. if false is specified then no unzip will be attempted. if true is specified then unzip will use the unzip dir set in ICCResult or to a temp file if. it is not set. i.e. this will force an unzip if true is specified. -
getStream
Returns an input stream to the contents if it is available.isSourceAvailable()can be used to determine if source is available. AFileInputStreamwill be returned if the file is available on the file system otherwise a basicInputStreamis returned. Caller must close the stream when done UsegetEncoding()to determine the encoding of the contents- Specified by:
getStreamin interfaceICCSource- Returns:
InputStreamto the file's contents or null if source is not available- Throws:
IOException- error getting stream
-
getStream
Same asgetStream()but can return the input stream with code coverage indicators injected. if false is specified then no markers will be injected and the behavior will be the same asgetStream(). if true is specified an input stream with code coverage markers injected will be returned- Specified by:
getStreamin interfaceICCSource- Parameters:
includeMarkers- include code coverage markers- Returns:
- input stream with markers
- Throws:
IOException- exception getting stream- Since:
- 10.0
-
getEncoding
String getEncoding()Return the encoding of the stream or file returned by the implementer of this interface SeeCharsetfor a suggested list of possible encodings- Specified by:
getEncodingin interfaceICCSource- Returns:
- the encoding of the stream or file returned by this artifact, JVM's default charset if it is not known
- Since:
- 7.0
-
getSignature
byte[] getSignature()Returns an array of bytes that represent a unique signature for this file's contents The implementation guarantees that the signature from files that have the exact same content will match This can be used to compare with another file to make sure it is the same. This may be generated on the fly or cached for faster lookup- Returns:
- an array of bytes that represents a unique signature based on the file contents or null if there is no file content
- Since:
- 4.0
-
getLanguage
int getLanguage()Return an int that represents the compiled language of the file Refer toICCConstantsfor possible values- Specified by:
getLanguagein interfaceICCSource- Returns:
- one of languages in
ICCConstants
-
getFlowPoints
ICCFlowPoint[] getFlowPoints()Returns a flat list of flowpoints. To obtain the structure of the flowpoints usegetRootFlowPoints()to obtain 1 or more root flowpoints and then navigate the hierarchy. The list is obtained during collection and may not represent a complete list as it appears in the source. Debug technology and compiler optimization may not expose all the functions for some languages. In v9 the returned list is sorted by the flowpoint's first line number. This will reflect the order that they appear in file. While this is a flattened list each flowpoint may have a parent and/or childrenNOTE: the implementation of this call may be cached to improve performance. Importers (classes that populate flowpoints) should use getChildren() calls to work with lists of flowpoints to avoid locking in this cached value unless the caller knows the population of flowpoints has been completed.
- Returns:
- array of
ICCFlowPointfunctions/entry points
-
getFlowPoint
Returns the first flow point with the given name When there is a flowpoint hierarchy, this will only return the first entry in the hierarchy that is found to match the name. If the passed name is qualified then the flowpoint hierarchy will be traversed looking for the matching flowpoint For most languages this may be correct as there is only one entry that matches the name. For languages that can have the same flowpoint in different scopes usegetFlowPoints(String)to get all matches.NOTE: the implementation of this call may be cached to improve performance. Importers (classes that populate flowpoints) should use getChildren() calls to work with lists of flowpoints to avoid locking in this cached value unless the caller knows the population of flowpoints has been completed.
- Parameters:
name- flowpoint name- Returns:
- null or flowpoint that matches the name
-
getFlowPointByQualifiedName
Returns the first flow point with the given qualified name, using / as a separatorNOTE: the implementation of this call may be cached to improve performance. Importers (classes that populate flowpoints) should use getChildren() calls to work with lists of flowpoints to avoid locking in this cached value unless the caller knows the population of flowpoints has been completed.
- Parameters:
qualifiedName- flowpoint qualified name- Returns:
- null or flowpoint that matches the qualified name
- Since:
- 10.0
-
getFlowPoints
Return zero of more flowpoints that match the name. UnlikegetFlowPoint(String)it will return all flowpoints that match This will scan the whole hierarchy looking for a match. The order of the returned list is undefinedNOTE: the implementation of this call may be cached to improve performance. Importers (classes that populate flowpoints) should use getChildren() calls to work with lists of flowpoints to avoid locking in this cached value unless the caller knows the population of flowpoints has been completed.
- Parameters:
name- flowpoint name- Returns:
- zero or more matches
- Since:
- 8.0
-
getFlowPoint
Returns the ICCFlowPoint with the matching ID or nullNOTE: the implementation of this call may be cached to improve performance. Importers (classes that populate flowpoints) should use getChildren() calls to work with lists of flowpoints to avoid locking in this cached value unless the caller knows the population of flowpoints has been completed.
- Parameters:
id- flowpoint id- Returns:
ICCFlowPointor null- Since:
- 9.0
-
isNameMatch
Indicates whether or not the specified file name matches the name for this file.- Parameters:
fileName- the file name to check, may or may not include file extension or be a base name- Returns:
- true if the base name matches, false otherwise
- Since:
- 3.1
-
getRootFlowPoints
ICCFlowPoint[] getRootFlowPoints()The list of root (ie have no parents) flowpoints.
Flowpoints are obtained during collection and may not represent a complete list as it appears in the source Debug technology and compiler optimization may not expose all the functions for some languages In v9 this list will be sorted by the flowpoint's first line number- Returns:
- array of
ICCFlowPointroot functions/entry points - Since:
- 4.0
-
isSourceAvailable
boolean isSourceAvailable()Returns true if the contents of this file are availablegetFile()can be used to get at the contents from the file systemgetStream()can be used to get the contents from both the file system or from a zip- Specified by:
isSourceAvailablein interfaceICCSource- Returns:
- true if source is available
- Since:
- 4.0
-
getSourceZipPath
String getSourceZipPath()Returns a path to the zip that contains the source This can be used when the caller wants to extract and manage the contents- Returns:
- source zip path
- Since:
- 4.0
-
getSourceDirectory
String getSourceDirectory()Returns the source directory. In the case of a zip this is the directory inside the zip and is relative to the root of the zip file- Returns:
- source directory
- Since:
- 4.0
-
getParts
ICCPart[] getParts()Returns 0 or more artifacts that were created as a result of processing this file e.g. a compile unit or object that was created when this file was compiled- Returns:
- array of zero or more parts
- Since:
- 6.0
-