Package com.tonic.analysis.pattern
Class SearchResult
- java.lang.Object
-
- com.tonic.analysis.pattern.SearchResult
-
public class SearchResult extends Object
A single pattern-search hit, locating a class, method, or IR instruction with a description.
-
-
Constructor Summary
Constructors Constructor Description SearchResult(ClassFile classFile, MethodEntry method, IRInstruction instruction, int bytecodeOffset, String description)Creates an instruction-level result.SearchResult(ClassFile classFile, MethodEntry method, String description)Creates a method-level result with no instruction.SearchResult(ClassFile classFile, String description)Creates a class-level result with no method or instruction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetBytecodeOffset()ClassFilegetClassFile()StringgetClassName()StringgetDescription()IRInstructiongetInstruction()StringgetLocation()Formats the result location as class, optional method signature, and optional bytecode offset.MethodEntrygetMethod()StringgetMethodDescriptor()StringgetMethodName()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
SearchResult
public SearchResult(ClassFile classFile, MethodEntry method, IRInstruction instruction, int bytecodeOffset, String description)
Creates an instruction-level result.- Parameters:
classFile- the class the result refers tomethod- the matched method, may be nullinstruction- the matched IR instruction, may be nullbytecodeOffset- the bytecode offset, or -1 if unknowndescription- what was matched
-
SearchResult
public SearchResult(ClassFile classFile, MethodEntry method, String description)
Creates a method-level result with no instruction.- Parameters:
classFile- the class the result refers tomethod- the matched methoddescription- what was matched
-
-
Method Detail
-
getClassFile
public ClassFile getClassFile()
- Returns:
- the class file
-
getMethod
public MethodEntry getMethod()
- Returns:
- the method
-
getInstruction
public IRInstruction getInstruction()
- Returns:
- the instruction
-
getBytecodeOffset
public int getBytecodeOffset()
- Returns:
- the bytecode offset
-
getDescription
public String getDescription()
- Returns:
- the description
-
getClassName
public String getClassName()
- Returns:
- the class name, or null if no class is attached
-
getMethodName
public String getMethodName()
- Returns:
- the method name, or null if no method is attached
-
getMethodDescriptor
public String getMethodDescriptor()
- Returns:
- the method descriptor, or null if no method is attached
-
getLocation
public String getLocation()
Formats the result location as class, optional method signature, and optional bytecode offset.- Returns:
- the human-readable location string
-
-