예제 #1
0
 @Override
 public ConvertProcessor create(
     Map<String, Processor.Factory> registry, String processorTag, Map<String, Object> config)
     throws Exception {
   String field = ConfigurationUtils.readStringProperty(TYPE, processorTag, config, "field");
   String typeProperty =
       ConfigurationUtils.readStringProperty(TYPE, processorTag, config, "type");
   String targetField =
       ConfigurationUtils.readStringProperty(TYPE, processorTag, config, "target_field", field);
   Type convertType = Type.fromString(processorTag, "type", typeProperty);
   boolean ignoreMissing =
       ConfigurationUtils.readBooleanProperty(
           TYPE, processorTag, config, "ignore_missing", false);
   return new ConvertProcessor(processorTag, field, targetField, convertType, ignoreMissing);
 }
예제 #2
0
 @Override
 public SetProcessor create(
     Map<String, Processor.Factory> registry, String processorTag, Map<String, Object> config)
     throws Exception {
   String field = ConfigurationUtils.readStringProperty(TYPE, processorTag, config, "field");
   Object value = ConfigurationUtils.readObject(TYPE, processorTag, config, "value");
   boolean overrideEnabled =
       ConfigurationUtils.readBooleanProperty(TYPE, processorTag, config, "override", true);
   return new SetProcessor(
       processorTag,
       templateService.compile(field),
       ValueSource.wrap(value, templateService),
       overrideEnabled);
 }