// needed for field access: I cannot work in the proxied version
Object unproxiedInstance = unproxy( instance, objectInitializer );
// process the class bridges
for ( int i = 0; i < propertiesMetadata.classBridges.size(); i++ ) {
FieldBridge fb = propertiesMetadata.classBridges.get( i );
final String fieldName = propertiesMetadata.classNames.get( i );
contextualBridge
.setFieldBridge( fb )
.setFieldName( fieldName )
.set(
fieldName, unproxiedInstance,
doc, propertiesMetadata.getClassLuceneOptions( i )
);
}
// process the indexed fields
XMember previousMember = null;
Object currentFieldValue = null;
for ( int i = 0; i < propertiesMetadata.fieldNames.size(); i++ ) {
XMember member = propertiesMetadata.fieldGetters.get( i );
if ( previousMember != member ) {
currentFieldValue = ReflectionHelper.getMemberValue( unproxiedInstance, member );
previousMember = member;
}
final FieldBridge fieldBridge = propertiesMetadata.fieldBridges.get( i );
final String fieldName = propertiesMetadata.fieldNames.get( i );
contextualBridge
.setFieldBridge( fieldBridge )
.pushMethod( member )
.setFieldName( fieldName )