uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörn Kottmann <kottm...@gmail.com>
Subject Re: How to deal with types which define allowed values?
Date Mon, 06 Jun 2011 11:01:04 GMT
On 6/6/11 12:24 PM, Richard Eckart de Castilho wrote:
>        // check for string subtypes
>        if (type instanceof StringTypeImpl) {
> 	LowLevelTypeSystem lts = aTypeSystem.getLowLevelTypeSystem();
> 	final int typeCode = lts.ll_getCodeForType(type);
>          String[] strings = lts.ll_getStringSet(typeCode);
>          AllowedValue[] allowedVals = new AllowedValue[strings.length];
>          for (int i = 0; i<  strings.length; i++) {
>            allowedVals[i] = factory.createAllowedValue();
>            allowedVals[i].setString(strings[i]);
>          }
>          typeDesc.setAllowedValues(allowedVals);
>        }

Does LowLevelTypeSystem.getStringSet simply return an empty array in the 
case
someone defined a string subtype but does not define
allowed values? Or is it possible to define a string subtype
with an empty set of allowed values?

Jörn

Mime
View raw message