}
final ImmutableList.Builder<Extractor> listBuilder = ImmutableList.builder();
final BasicDBList mEx = (BasicDBList) input.getFields().get(InputImpl.EMBEDDED_EXTRACTORS);
for (final Object element : mEx) {
final DBObject ex = (BasicDBObject) element;
// SOFT MIGRATION: does this extractor have an order set? Implemented for issue: #726
Long order = 0l;
if (ex.containsField(Extractor.FIELD_ORDER)) {
order = (Long) ex.get(Extractor.FIELD_ORDER); // mongodb driver gives us a java.lang.Long
}
try {
final Extractor extractor = extractorFactory.factory(
(String) ex.get(Extractor.FIELD_ID),
(String) ex.get(Extractor.FIELD_TITLE),
order.intValue(),
Extractor.CursorStrategy.valueOf(((String) ex.get(Extractor.FIELD_CURSOR_STRATEGY)).toUpperCase()),
Extractor.Type.valueOf(((String) ex.get(Extractor.FIELD_TYPE)).toUpperCase()),
(String) ex.get(Extractor.FIELD_SOURCE_FIELD),
(String) ex.get(Extractor.FIELD_TARGET_FIELD),
(Map<String, Object>) ex.get(Extractor.FIELD_EXTRACTOR_CONFIG),
(String) ex.get(Extractor.FIELD_CREATOR_USER_ID),
getConvertersOfExtractor(ex),
Extractor.ConditionType.valueOf(((String) ex.get(Extractor.FIELD_CONDITION_TYPE)).toUpperCase()),
(String) ex.get(Extractor.FIELD_CONDITION_VALUE)
);
listBuilder.add(extractor);
} catch (Exception e) {
LOG.error("Cannot build extractor from persisted data. Skipping.", e);