}
}
else if (fieldable instanceof Field) {
Field safeField = (Field) fieldable;
if ( safeField.isBinary() ) {
serializer.addFieldWithBinaryData( new LuceneFieldContext( safeField ) );
}
else if ( safeField.stringValue() != null ) {
serializer.addFieldWithStringData( new LuceneFieldContext( safeField ) );
}
else if ( safeField.readerValue() != null && safeField.readerValue() instanceof Serializable ) {
serializer.addFieldWithSerializableReaderData( new LuceneFieldContext( safeField ) );
}
else if ( safeField.readerValue() != null ) {
throw log.conversionFromReaderToStringNotYetImplemented();
}
else if ( safeField.tokenStreamValue() != null ) {
serializer.addFieldWithTokenStreamData( new LuceneFieldContext( safeField ) );
}
else {
throw log.unknownFieldType( safeField.getClass() );
}
}