Class 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 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 inspected
        argIndex - the zero-based parameter position
        Returns:
        a type value for that parameter, or Value.ABSENT when 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 inspected
        argIndex - the zero-based parameter position
        Returns:
        the lower-cased kind name, any when 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 inspected
        argIndex - the zero-based parameter position
        Returns:
        the constant, or Value.ABSENT when the producer is unknown or not a constant