Class OperationParser

java.lang.Object
randoop.operation.OperationParser

public class OperationParser extends Object
Parser for text serialization (string representation) of Operations. See parse(java.lang.String) for format details.
See Also:
  • Constructor Details

    • OperationParser

      private OperationParser()
  • Method Details

    • parse

      public static TypedOperation parse(String str) throws OperationParseException
      Parses a string representing an Operation. The string is expected to be of the form:
         ID : DESCRIPTION
       
      Where ID is a string identifying the type of Operation, and DESCRIPTION represents more specifics of the Operation. For example, the following String represents the constructor for HashMap:
      
       cons : java.util.HashMap.<init>()
       
      A class implementing Operation should define a static field named ID that corresponds to the ID string used when parsing. The way this parse method works is by using the ID string to determine the specific Operation class C, and the calling C.parse(String) on the DESCRIPTION String.

      For more details on the exact form of DESCRIPTION, see the different classes implementing Operation.

      Parameters:
      str - the string to be parsed
      Returns:
      the operation for the given string descriptor
      Throws:
      OperationParseException - if the string does not have expected format