uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thilo Goetz <twgo...@gmx.de>
Subject Re: [UIMA] How to get the element type from a TypeSystem Object
Date Mon, 20 Oct 2008 09:47:57 GMT
Manuel Fiorelli wrote:
> I need to get the element type of a feature from a TypeSystem object. I
> didn't find any method in the Feature interface. However, when I have a
> definition like that
> 
> <featureDescription>
> <name>foo</name>
> <rangeTypeName>uima.cas.FSArray</rangeType>
> <elementType>uima.cas.Boolean</elementType>
> </featureDescription>
> 
> then, foo.getRange().getComponentType() gives uima.cas.Boolean, as I
> expected.
> But, if the range type is uima.cas.FSList I know no way to get the element
> type.
> 
> I tried the code
> 
> TypeSystemUtil.feature2FeatureDescription(base_foo).getElementType()
> 
> but it returns null.
> 
> Manuel Fiorelli
> 

Lists don't work the same way as arrays.  They don't use the
elementType declaration, so you can't get at their "element
type" using getElementType().  In fact, since you can't declare
an element type, that wouldn't make much sense anyway ;-).

If you tell us what it is your trying to achieve, maybe we
can suggest a workaround.

--Thilo


Mime
View raw message