public class TestValueExtractor extends DefaultClassVisitor
TestValueExtractor
is a ClassVisitor
that inspects the fields passed to it to see
if they are annotated with TestValue
, are static, and have type that is
primitive, String, or an array of primitive or String.Modifier and Type | Field and Description |
---|---|
private java.util.Set<Sequence> |
valueSequences |
Constructor and Description |
---|
TestValueExtractor(java.util.Set<Sequence> valueSequences) |
Modifier and Type | Method and Description |
---|---|
private java.util.List<java.lang.Object> |
getValue(java.lang.reflect.Field f)
Returns the value stored in the given (static) field with primitive, String or array of
primitive or String type.
|
private static void |
printDetectedAnnotatedFieldMsg(java.lang.reflect.Field f)
Prints an informational message that an annotated field has been found.
|
void |
visit(java.lang.reflect.Field f)
Perform an action on a field.
|
toString, visit, visit, visit, visit, visitAfter, visitBefore
private final java.util.Set<Sequence> valueSequences
public TestValueExtractor(java.util.Set<Sequence> valueSequences)
public void visit(java.lang.reflect.Field f)
If the field is static and is annotated with randoop.TestValue
, adds the value of
the field to the sequence set constructed by this visitor. Requires that the field type be
primitive, String, or an array of primitive or String type.
visit
in interface ClassVisitor
visit
in class DefaultClassVisitor
f
- the fieldprivate java.util.List<java.lang.Object> getValue(java.lang.reflect.Field f)
f
- the fieldprivate static void printDetectedAnnotatedFieldMsg(java.lang.reflect.Field f)
f
- the field