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, isInFilteredRegion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calculateLocalPreprocessedTokens, getAbstractSyntaxTree, getClangTranslationUnitWrapper, getLanguage, getRootEntity, getTextContent, getTokens, getTypeResolution, getUniformPath
public TestCheckContext(java.io.File codeFile, CheckInfo checkInfo) throws java.io.IOException
java.io.IOException
public 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)
ICheckContext
createFindingForElement
in interface ICheckContext
public java.lang.String getFindingsString()
public java.lang.StringBuilder getFindings()
findingsStringBuilder
public CheckInfo getCheckInfo()
checkInfo
public void createFindingForLines(java.lang.String message, int startLine, int endLine, ECodeViewOption.ETextViewOption view)
ICheckContext
ECodeViewOption.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 ICheckContext
public void createFindingForOffsets(java.lang.String message, int startOffset, int endOffset, ECodeViewOption.ETextViewOption view)
ICheckContext
ECodeViewOption.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 ICheckContext
public void createFindingForSiblingsInCurrentFile(java.lang.String message, java.util.List<OffsetBasedRegion> regions)
ICheckContext
OffsetBasedRegion
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 ICheckContext
public void createFindingForSiblings(java.lang.String message, CheckTextRegionLocation mainLocation, java.util.List<CheckTextRegionLocation> siblingLocations)
ICheckContext
ECodeViewOption.ETextViewOption.UNFILTERED_CONTENT
.createFindingForSiblings
in interface ICheckContext
protected void accessAst()
TestTokenElementContext
accessAst
in class TestTokenElementContext
protected void accessTypeResolution()
TestTokenElementContext
accessTypeResolution
in class TestTokenElementContext
public <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)
ICheckContext
accessPhaseResult
in interface ICheckContext
public <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)
ICheckContext
accessPhaseInvertedResult
in interface ICheckContext
public <T extends IExtractedValue<D>,D extends java.io.Serializable> java.util.List<java.lang.String> listAllPhaseValues(java.lang.Class<? extends IGlobalExtractionPhase<T,D>> phaseClass)
ICheckContext
listAllPhaseValues
in interface ICheckContext