Retrieve name type from field

#1

Hi,
I have this types:

typeA {

arrayTypeB:[typeB]

}

how can I get the name of typeB in typeA.arrayTypeB ?

I tried:

> typeA.get("typeA_id","arrayTypeB.name")
> typeA.get("typeA_id","arrayTypeB")
> typeA.get("typeA_id","arrayTypeB.this")
> typeA.get("typeA_id","{arrayTypeB:[this,name]}")

but none of them work.

How can I fix it?

thanks

#2

If you have TypeA object a1, you can do,
a1.type().valueType(‘arrayTypeB’).elementType().typeName() will do.
if you read result of each chained call,
a1.type() will give TypeA ( not just name whole definiton)
a1.type().valueType(‘arrayTypeB’) will give again definiton of Arry type, as that is an array.
Sine you know it as array( other wise, you would have check , it this is Primitive, ReferenceType, CollectionType), you can do elementType and get typename…

You can get more info on type system in doccumentation->topics ->typesystem.