[
https://issues.apache.org/jira/browse/UIMA-2801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Eckart de Castilho resolved UIMA-2801.
----------------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0uimaFIT
> Allow multi-valued external resources
> -------------------------------------
>
> Key: UIMA-2801
> URL: https://issues.apache.org/jira/browse/UIMA-2801
> Project: UIMA
> Issue Type: Improvement
> Components: uimaFIT
> Reporter: Richard Eckart de Castilho
> Assignee: Richard Eckart de Castilho
> Fix For: 2.0.0uimaFIT, 2.1.0uimaFIT
>
>
> Currently, there can only be one external resource per key, e.g.:
> {code}
> final static String MODEL_KEY = "Model";
> @ExternalResource(key = MODEL_KEY)
> private SharedModel model;
> ---
> AnalysisEngineDescription aed1 = createPrimitiveDescription(Annotator.class,
> Annotator.MODEL_KEY, extDesc);
> {code}
> There are cases where we want to pass a multiple external resources at a
> time, e.g. multiple models when can be used jointly by a component. It is
> inconvenient to have the component declare one key per model, because we do
> not know their number in advance. Adding support for adding multi-valued
> external resources in uimaj-core looks like a major change, as the XML
> descriptors would need to be extended. At the level of uimaFIT, it should be
> rather easy to implement something like this:
> {code}
> final static String MODEL_KEY = "Model";
> @ExternalResource(key = MODEL_KEY)
> private List<SharedModel> model;
> ---
> AnalysisEngineDescription aed1 = createPrimitiveDescription(Annotator.class,
> Annotator.MODEL_KEY, asList(extDesc1, extDesc2, extDesc3));
> {code}
> uimaFIT may implicitly bind the three values to "Model#1", "Model#2", and
> "Model#3". When configuring a component, it can check that the external
> resource parameter field is multi-valued and look for the keys with the "#X"
> postfixes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira