本文整理了Java中com.hurence.logisland.component.PropertyValue.evaluate()
方法的一些代码示例,展示了PropertyValue.evaluate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PropertyValue.evaluate()
方法的具体详情如下:
包路径:com.hurence.logisland.component.PropertyValue
类名称:PropertyValue
方法名:evaluate
[英]In the case of PropertyDescriptors that do support expression language, the fill method allows to obtain a PropertyValue that is filled in with record content.
[中]对于支持表达式语言的PropertyDescriptor,fill方法允许获取用记录内容填充的PropertyValue。
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
private void updateRecord(ProcessContext context, Record record, Map<String, String> fieldsNameMapping) {
String conflictPolicy = context.getPropertyValue(CONFLICT_RESOLUTION_POLICY).asString();
if ((fieldsNameMapping == null) || (fieldsNameMapping.keySet() == null)) {
return;
}
fieldsNameMapping.keySet().forEach(addedFieldName -> {
final String defaultValueToAdd = context.getPropertyValue(addedFieldName).evaluate(record).asString();
// field is already here
if (record.hasField(addedFieldName)) {
if (conflictPolicy.equals(OVERWRITE_EXISTING.getValue())) {
overwriteObsoleteFieldValue(record, addedFieldName, defaultValueToAdd);
}
} else {
record.setStringField(addedFieldName, defaultValueToAdd);
}
});
}
代码示例来源:origin: com.hurence.logisland/logisland-elasticsearch-plugin
recordKeyName = context.getPropertyValue(RECORD_KEY_FIELD).evaluate(record).asString();
indexName = context.getPropertyValue(ES_INDEX_FIELD).evaluate(record).asString();
typeName = context.getPropertyValue(ES_TYPE_FIELD).evaluate(record).asString();
includesFieldName = context.getPropertyValue(ES_INCLUDES_FIELD).evaluate(record).asString();
} catch (Throwable t) {
record.setStringField(FieldDictionary.RECORD_ERRORS, "Failure in executing EL. Error: " + t.getMessage());
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
recordKeyName = context.getPropertyValue(RECORD_KEY_FIELD).evaluate(record).asString();
indexName = context.getPropertyValue(COLLECTION_NAME).evaluate(record).asString();
if (context.getPropertyValue(TYPE_NAME).isSet())
typeName = context.getPropertyValue(TYPE_NAME).evaluate(record).asString();
includesFieldName = context.getPropertyValue(INCLUDES_FIELD).evaluate(record).asString();
} catch (Throwable t) {
record.setStringField(FieldDictionary.RECORD_ERRORS, "Failure in executing EL. Error: " + t.getMessage());
内容来源于网络,如有侵权,请联系作者删除!