uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Tomás Atria <jtat...@gmail.com>
Subject nconsistent API for engine and resource creation?
Date Tue, 20 Oct 2015 17:01:56 GMT
I had posted the message below to the old uimafit-users list and didn't
notice it was no onger being used. See message below.

=====

Hello,

i just noticed that the method for creation of analysis engines and
external resources is different.

For AE's, this works:

AnalysisEngineFactory.createEngineDescription(
   SomeEngine.class,SomeEngine.PARAM_BOOLEAN, true
)

But for external resources, the same syntax fails with a ClassCastException

ExternalResourceFactory.createExternalResourceDescription(
    SomeResource.class, SomeResource.PARAM_BOOLEAN, true
)

Looking at the code, I see that
ExternalResourceFactory.createExternalResourceDescription(String,Class<?
extends Resource>,Object...), which is called by the method above, actually
casts parameter values to String on line 177.

Why is this so? Wouldn't it be preferable to have a consistent interface
for all component types?

Thanks!
jta


-- 
entia non sunt multiplicanda praeter necessitatem

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message