Search in sources :

Example 1 with BindingStructuralType

use of org.opendaylight.mdsal.binding.dom.adapter.BindingStructuralType in project controller by opendaylight.

the class LazyDataObjectModification method populateList.

private static void populateList(final List<DataObjectModification<? extends DataObject>> result, final BindingCodecTreeNode<?> parentCodec, final Collection<DataTreeCandidateNode> domChildNodes) {
    for (final DataTreeCandidateNode domChildNode : domChildNodes) {
        final BindingStructuralType type = BindingStructuralType.from(domChildNode);
        if (type != BindingStructuralType.NOT_ADDRESSABLE) {
            /*
                 *  Even if type is UNKNOWN, from perspective of BindingStructuralType
                 *  we try to load codec for it. We will use that type to further specify
                 *  debug log.
                 */
            try {
                final BindingCodecTreeNode<?> childCodec = parentCodec.yangPathArgumentChild(domChildNode.getIdentifier());
                populateList(result, type, childCodec, domChildNode);
            } catch (final IllegalArgumentException e) {
                if (type == BindingStructuralType.UNKNOWN) {
                    LOG.debug("Unable to deserialize unknown DOM node {}", domChildNode, e);
                } else {
                    LOG.debug("Binding representation for DOM node {} was not found", domChildNode, e);
                }
            }
        }
    }
}
Also used : DataTreeCandidateNode(org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode) BindingStructuralType(org.opendaylight.mdsal.binding.dom.adapter.BindingStructuralType)

Aggregations

BindingStructuralType (org.opendaylight.mdsal.binding.dom.adapter.BindingStructuralType)1 DataTreeCandidateNode (org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode)1