Package randoop.reflection
Class LiteralFileReader
- java.lang.Object
-
- randoop.reflection.LiteralFileReader
-
public class LiteralFileReader extends Object
Methodparse(java.lang.String)
reads a file specifying literal values to use during generation. The text file should contain one or more records of the form:START CLASSLITERALS CLASSNAME classname LITERALS type:value ... type:value END CLASSLITERALS
Capitalized text must appear literally. Lowercase text is as follows:- classname is the name of a class in Class.getName format. More specifically, TypeNames.getTypeForName(classname) must return a valid Class object.
- Each type:value pair describes the type and value of a literal (for example,
int:3
).
An example literals file appears in file randoop/systemTests/resources/literalsfile.txt.
LIMITATIONS:
Error messages do not include line numbers pointing to location of the error. There is no way to specify literals that are not related to any class in particular, or literals that are related to only specific methods within a class.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
LiteralFileReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
appendRecord(StringBuilder b, List<String> lines, int i)
static MultiMap<ClassOrInterfaceType,Sequence>
parse(String inFile)
Returns a map from class to list of constants.private static void
throwRecordSyntaxError(String string, List<String> lines, int i)
private static void
throwRecordSyntaxError(Throwable e)
Throw an error with the given exception as its cause.
-
-
-
Method Detail
-
parse
public static MultiMap<ClassOrInterfaceType,Sequence> parse(String inFile)
Returns a map from class to list of constants.- Parameters:
inFile
- the input file- Returns:
- the map from types to literal values
-
throwRecordSyntaxError
private static void throwRecordSyntaxError(Throwable e)
Throw an error with the given exception as its cause.- Parameters:
e
- the cause
-
throwRecordSyntaxError
private static void throwRecordSyntaxError(String string, List<String> lines, int i)
-
appendRecord
private static void appendRecord(StringBuilder b, List<String> lines, int i)
-
-