0

我有一个像 myProperties.properties 这样的属性文件。我想在UIMA JCasAnnotator_ImplBase 扩展类 中使用 spring 注释 @value 读取像 MAX_YEARS 这样的属性,如下所示。private @Value("${REQUIRED_COLUMNS}") String requiredColumns;

或者从 UIMA 框架中的属性文件读取属性的任何替代方法。提前致谢。纳拉辛哈。

4

1 回答 1

1

UIMA does not support value injection via Java annotations (from Spring or any other DI frameworks) at this time. It does support External Configuration Parameter Overrides, though.

uimaFIT offers annotations like @ConfigurationParameter to inject UIMA parameters into fields. These parameter values can come from descriptors automatically generated by uimaFIT using reflection, or they can come from pre-built XML descriptors.

When using pre-built XML descriptors, it should be possible to employ the External Configuration Parameter Overrides mechanism in conjunction with uimaFIT - but I am not sure if this has already been tried by anybody.

It may even be possible to employ the External Configuration Parameter Overrides mechanism with the descriptors internally generated by uimaFIT.

Disclosure: I am a developer on the UIMA project, focussing on uimaFIT.

于 2014-05-24T08:09:01.110 回答