Search in sources :

Example 1 with EventOption

use of org.eclipse.smarthome.core.types.EventOption in project smarthome by eclipse.

the class EventDescriptionConverter method unmarshal.

@Override
public final Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
    List<EventOption> eventOptions = null;
    NodeList nodes = (NodeList) context.convertAnother(context, NodeList.class);
    NodeIterator nodeIterator = new NodeIterator(nodes.getList());
    NodeList optionNodes = (NodeList) nodeIterator.next();
    if (optionNodes != null) {
        eventOptions = toListOfEventOptions(optionNodes);
    }
    nodeIterator.assertEndOfType();
    EventDescription eventDescription = new EventDescription(eventOptions);
    return eventDescription;
}
Also used : NodeIterator(org.eclipse.smarthome.config.xml.util.NodeIterator) NodeList(org.eclipse.smarthome.config.xml.util.NodeList) EventDescription(org.eclipse.smarthome.core.types.EventDescription) EventOption(org.eclipse.smarthome.core.types.EventOption)

Aggregations

NodeIterator (org.eclipse.smarthome.config.xml.util.NodeIterator)1 NodeList (org.eclipse.smarthome.config.xml.util.NodeList)1 EventDescription (org.eclipse.smarthome.core.types.EventDescription)1 EventOption (org.eclipse.smarthome.core.types.EventOption)1