R
- row typepublic class FieldExtractor<R>
extends java.lang.Object
ColumnTranslator
. This class
is used by cache package classes to get a list of primary key values for use as a CacheKey
.
The constructor performs all of the reflection initialization once by creating RowField
objects for each desired field. Then getFieldValues(Object)
can simply invoke reflection
methods to obtain the values for each row as needed.
Constructor and Description |
---|
FieldExtractor(AbstractWhereTranslator<R> whereTranslator)
Constructs for where translator columns.
|
FieldExtractor(RowTranslator<R> rowTranslator)
Constructs for all fields in row.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
getFieldValues(R row)
Gets the values of fields for a row.
|
java.lang.String |
toString(R row)
Gets field names and values for a row in the form of
"field1=value1 field2=value2 field3=value3..."
Typically this method is used for debugging.
|
public FieldExtractor(AbstractWhereTranslator<R> whereTranslator) throws ReflectException
whereTranslator
- use fields from this translatorReflectException
- if errorpublic FieldExtractor(RowTranslator<R> rowTranslator) throws ReflectException
rowTranslator
- use fields from this translatorReflectException
- if errorpublic java.lang.Object[] getFieldValues(R row) throws ReflectException
row
- obtain values from this rowReflectException
- if errorpublic java.lang.String toString(R row) throws ReflectException
row
- extract field values from this row objectReflectException
- if error