Package randoop.field

Class FieldParser

java.lang.Object
randoop.field.FieldParser

public class FieldParser extends Object
Recognizes a string representation of a field as part of parsing an Operation that is a FieldGet or FieldSet operation.
  • Constructor Details

    • FieldParser

      private FieldParser()
  • Method Details

    • parse

      public static AccessibleField parse(String descr, @ClassGetName String classname, String fieldname) throws OperationParseException
      Recognizes a field from a string description, using class and field name tokens, and returns a AccessibleField object.
      Parameters:
      descr - the full string description
      classname - the name of the field's declaring class
      fieldname - the name of the field
      Returns:
      the AccessibleField for the given class and field name
      Throws:
      OperationParseException - if either name is malformed or incorrect
    • fieldForName

      private static Field fieldForName(Class<?> type, String fieldName)
      Searches the field list of a class for a field that has the given name.
      Parameters:
      type - class object
      fieldName - field name for which to search the class
      Returns:
      field of the class with the given name