Package com.tonic.analysis.query.eval
Class ArgValueResolver
- java.lang.Object
-
- com.tonic.analysis.query.eval.ArgValueResolver
-
public final class ArgValueResolver extends Object
Resolves an argument of a call to its declared type, kind and (when a constant feeds the operand) literal value.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValuedeclaredType(Subject.CallSubject call, int argIndex)Reads the declared parameter descriptor out of the call's method descriptor.static Valuekind(Subject.CallSubject call, int argIndex)Classifies the instruction that pushes the argument (literal/local/field/...).static Valuevalue(Subject.CallSubject call, int argIndex)Reads the constant feeding the argument.
-
-
-
Method Detail
-
declaredType
public static Value declaredType(Subject.CallSubject call, int argIndex)
Reads the declared parameter descriptor out of the call's method descriptor.- Parameters:
call- the call being inspectedargIndex- the zero-based parameter position- Returns:
- a type value for that parameter, or
Value.ABSENTwhen the descriptor is unparsable or the position is out of range
-
kind
public static Value kind(Subject.CallSubject call, int argIndex)
Classifies the instruction that pushes the argument (literal/local/field/...).- Parameters:
call- the call being inspectedargIndex- the zero-based parameter position- Returns:
- the lower-cased kind name,
anywhen no producer could be located
-
value
public static Value value(Subject.CallSubject call, int argIndex)
Reads the constant feeding the argument.- Parameters:
call- the call being inspectedargIndex- the zero-based parameter position- Returns:
- the constant, or
Value.ABSENTwhen the producer is unknown or not a constant
-
-