How to extract Channel's associated Item-Type Information from .Things file .xml


Let’s say i define channel in .things file as :
Switch : status [ out-transform=“MAP(”, in-transform=“MAP(” ]

and in the channel-config:

> <channel-type id="status">
>         <item-type>Switch</item-type>
>         <label>Switch</label>
>        ....

Question is, how to get the Item-Type (i.e. Switch) from this overwrite function: @Override
public void channelLinked(ChannelUID channelUID) { }

Somehow i want to use this information to decide whether this channel supports state or command or both instead of providing another parameter for user to key in and decide, e.g. in-type, out-type. Thanks

Nvm… i found it…
String xx = this.thing.getChannel(channelUID.getId()).getAcceptedItemType();