Hi all,
the UimaContext defines two methods to access the value of a
configuration parameter based on name,
and the second based on name and group, the methods returns an object
which type depends on
the parameter configuration in the descriptor.
In an Analysis Engine implementation which access the configuration
parameters two things can go wrong:
- The expected type does not match the actual returned object type
- A mandatory parameter is missing
These two errors can only occur if the descriptor got out of sync with
the implementation, which can easily happen
to a user by updating to a newer version of an AE implemenation. The
newer AE version might have more or different
mandatory parameters, and types of existing parameters might have
changed as well.
An AE implementation which should not throw NullPointerExceptions are
ClassCastExceptions need to test for every
parameter if its not null in case it is mandatory and check for the
expected type before casting.
I think we should try to make accessing configuration parameters easier
in UIMA.
A simple solution could be to add new methods to UimaContext to access
configuration parameter values by type,
e.g. getStringConfigurationParameter(String aParamName, boolean mandatory).
Any thoughts?
Jörn