public interface ValueExtractor<T>
T.
A value extractor is tied to one specific type parameter of T. The ExtractedValue annotation
is used to mark that type parameter.
The extracted values are passed to the corresponding method of the ValueExtractor.ValueReceiver.
A typical value extractor implementation for List may look like this:
public class ListValueExtractor implements ValueExtractor<List<@ExtractedValue ?>> {
@Override
public void extractValues(List<?> originalValue, ValueReceiver receiver) {
for ( int i = 0; i < originalValue.size(); i++ ) {
receiver.indexedValue( "<iterable element>", i, originalValue.get( i ) );
}
}
}
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ValueExtractor.ValueReceiver
Provides a set of methods receiving value extracted by the
ValueExtractor. |
| Modifier and Type | Method and Description |
|---|---|
void |
extractValues(T originalValue,
ValueExtractor.ValueReceiver receiver)
Extracts the values to validate from the original object.
|
void extractValues(T originalValue, ValueExtractor.ValueReceiver receiver)
originalValue - the original value from which we want to extract the values to validatereceiver - the corresponding ValueReceiverCopyright © 2007-2017 Red Hat Inc. All Rights Reserved. Released under the Apache Software License 2.0.