public class TestCheckContext extends TestTokenElementContext implements ICheckContext
| Constructor and Description |
|---|
TestCheckContext(java.io.File codeFile,
CheckInfo checkInfo)
Constructor.
|
TestCheckContext(java.lang.String uniformPath,
java.lang.String code,
CheckInfo checkInfo) |
TestCheckContext(java.lang.String uniformPath,
java.lang.String unfilteredCode,
java.util.List<java.util.regex.Pattern> filterPatterns,
CheckInfo checkInfo) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
accessAst()
Template method that is called before accessing the AST.
|
<T extends IExtractedValue<D>,D extends java.io.Serializable> |
accessPhaseInvertedResult(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
Returns an accessor function to read inverted results of the provided phase.
|
<T extends IExtractedValue<D>,D extends java.io.Serializable> |
accessPhaseResult(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
Returns an accessor function to read results of the provided phase.
|
protected void |
accessTypeResolution()
Template method called before accessing type resolution.
|
void |
createFindingForElement(java.lang.String message)
Creates a finding with the given message for the whole analyzed token
element.
|
void |
createFindingForLines(java.lang.String message,
int startLine,
int endLine,
ECodeViewOption.ETextViewOption view)
Creates a finding with the given message from the given start line
(inclusive) to the given end line (inclusive).
|
void |
createFindingForOffsets(java.lang.String message,
int startOffset,
int endOffset,
ECodeViewOption.ETextViewOption view)
Creates a finding with the given message from the given start offset
(inclusive) to the given end offset (inclusive).
|
void |
createFindingForSiblings(java.lang.String message,
CheckTextRegionLocation mainLocation,
java.util.List<CheckTextRegionLocation> siblingLocations)
Creates one finding for the given message and main location.
|
void |
createFindingForSiblingsInCurrentFile(java.lang.String message,
java.util.List<OffsetBasedRegion> regions)
Creates a finding for each entry in the given List of
OffsetBasedRegion with the given message from the given start offsets
(inclusive) to the corresponding end offsets (inclusive). |
CheckInfo |
getCheckInfo() |
java.lang.StringBuilder |
getFindings() |
java.lang.String |
getFindingsString()
Returns a string representation of the findings found.
|
<T extends IExtractedValue<D>,D extends java.io.Serializable> |
listAllPhaseValues(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
Returns all values that have been extracted by the phase.
|
getAbstractSyntaxTree, getClangTranslationUnitWrapper, getFilteredOffset, getLanguage, getRootEntity, getTextContent, getTokens, getTypeResolution, getUniformPath, isInFilteredRegionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcalculateLocalPreprocessedTokens, getAbstractSyntaxTree, getClangTranslationUnitWrapper, getLanguage, getRootEntity, getTextContent, getTokens, getTypeResolution, getUniformPathpublic TestCheckContext(java.io.File codeFile, CheckInfo checkInfo) throws java.io.IOException
java.io.IOExceptionpublic TestCheckContext(java.lang.String uniformPath, java.lang.String code, CheckInfo checkInfo)
public TestCheckContext(java.lang.String uniformPath, java.lang.String unfilteredCode, java.util.List<java.util.regex.Pattern> filterPatterns, CheckInfo checkInfo)
public void createFindingForElement(java.lang.String message)
ICheckContextcreateFindingForElement in interface ICheckContextpublic java.lang.String getFindingsString()
public java.lang.StringBuilder getFindings()
findingsStringBuilderpublic CheckInfo getCheckInfo()
checkInfopublic void createFindingForLines(java.lang.String message, int startLine, int endLine, ECodeViewOption.ETextViewOption view)
ICheckContextECodeViewOption.ETextViewOption that was used to get the token stream.
If textView is ECodeViewOption.ETextViewOption.UNFILTERED_CONTENT and the finding
refers to filtered code, then it will be ignored.createFindingForLines in interface ICheckContextpublic void createFindingForOffsets(java.lang.String message, int startOffset, int endOffset, ECodeViewOption.ETextViewOption view)
ICheckContextECodeViewOption.ETextViewOption that was used to get the token stream.
If textView is ECodeViewOption.ETextViewOption.UNFILTERED_CONTENT and the finding
refers to filtered code, then it will be ignored.createFindingForOffsets in interface ICheckContextpublic void createFindingForSiblingsInCurrentFile(java.lang.String message, java.util.List<OffsetBasedRegion> regions)
ICheckContextOffsetBasedRegion with the given message from the given start offsets
(inclusive) to the corresponding end offsets (inclusive).
Offsets must be based on filtered content
(ECodeViewOption.ETextViewOption.FILTERED_CONTENT).createFindingForSiblingsInCurrentFile in interface ICheckContextpublic void createFindingForSiblings(java.lang.String message, CheckTextRegionLocation mainLocation, java.util.List<CheckTextRegionLocation> siblingLocations)
ICheckContextECodeViewOption.ETextViewOption.UNFILTERED_CONTENT.createFindingForSiblings in interface ICheckContextprotected void accessAst()
TestTokenElementContextaccessAst in class TestTokenElementContextprotected void accessTypeResolution()
TestTokenElementContextaccessTypeResolution in class TestTokenElementContextpublic <T extends IExtractedValue<D>,D extends java.io.Serializable> java.util.function.Function<java.lang.String,java.util.List<T>> accessPhaseResult(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
ICheckContextaccessPhaseResult in interface ICheckContextpublic <T extends IExtractedValue<D>,D extends java.io.Serializable> java.util.function.Function<java.lang.String,java.util.List<T>> accessPhaseInvertedResult(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
ICheckContextaccessPhaseInvertedResult in interface ICheckContextpublic <T extends IExtractedValue<D>,D extends java.io.Serializable> java.util.List<java.lang.String> listAllPhaseValues(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
ICheckContextlistAllPhaseValues in interface ICheckContext