safeField.isOmitNorms(),
safeField.isOmitTermFreqAndPositions()
);
}
else {
throw new SearchException( "Unknown SerializableNumericField: " + field.getClass() );
}
}
else if ( field instanceof SerializableField ) {
SerializableField safeField = (SerializableField) field;
if ( field instanceof SerializableBinaryField ) {
SerializableBinaryField reallySafeField = (SerializableBinaryField) field;
hydrator.addFieldWithBinaryData(
reallySafeField.getName(),
reallySafeField.getValue(),
reallySafeField.getOffset(),
reallySafeField.getLength(),
safeField.getBoost(),
safeField.isOmitNorms(),
safeField.isOmitTermFreqAndPositions()
);
}
else if ( field instanceof SerializableStringField ) {
SerializableStringField reallySafeField = (SerializableStringField) field;
hydrator.addFieldWithStringData(
reallySafeField.getName(),
reallySafeField.getValue(),
reallySafeField.getStore(),
reallySafeField.getIndex(),
reallySafeField.getTermVector(),
safeField.getBoost(),
safeField.isOmitNorms(),
safeField.isOmitTermFreqAndPositions()
);
}
else if ( field instanceof SerializableTokenStreamField ) {
SerializableTokenStreamField reallySafeField = (SerializableTokenStreamField) field;
List<List<AttributeImpl>> tokens = reallySafeField.getValue().getStream();
for ( List<AttributeImpl> token : tokens ) {
for ( AttributeImpl attribute : token ) {
hydrator.addAttributeInstance( attribute );
}
hydrator.addToken();
}
hydrator.addFieldWithTokenStreamData(
reallySafeField.getName(),
reallySafeField.getTermVector(),
safeField.getBoost(),
safeField.isOmitNorms(),
safeField.isOmitTermFreqAndPositions()
);
}
else if ( field instanceof SerializableReaderField ) {
SerializableReaderField reallySafeField = (SerializableReaderField) field;
hydrator.addFieldWithSerializableReaderData(
reallySafeField.getName(),
reallySafeField.getValue(),
reallySafeField.getTermVector(),
safeField.getBoost(),
safeField.isOmitNorms(),
safeField.isOmitTermFreqAndPositions()
);
}
else {
throw new SearchException( "Unknown SerializableField: " + field.getClass() );
}
}
else {
throw new SearchException( "Unknown SerializableFieldable: " + field.getClass() );
}
}
}