Manuel Fiorelli wrote:
I need to convert a data representation into a CAS. Then, I would like to
check the list element type to see if the data type were convertible.
Reading this paragraph

http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.xml.component_descriptor.type_system.features

I convinced myself that elementType was applicable also to list types. May
be there is an error in the documentation?

I'm afraid so.  Looks like this was wishful thinking on the part
of whoever wrote that.  The code for getComponentType() looks
like this:

  public Type getComponentType() {
    if (!isArray()) {
      return null;
    }
    return this.ts.ll_getTypeForCode(this.ts.ll_getComponentType(this.code));
  }

So lists are not covered.  I don't know what happens if you
specify a component type for a list valued feature in a
descriptor, but I expect it will raise some kind of
exception.  Please open a Jira issue, we should at least
fix the documentation.  Thanks for pointing this out.

--Thilo


Manuel Fiorelli

Reply via email to