2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml;
11 import com.google.common.collect.Lists;
12 import org.opendaylight.controller.netconf.util.xml.XmlElement;
14 import java.util.List;
16 public class ArrayAttributeReadingStrategy extends AbstractAttributeReadingStrategy {
18 private final AttributeReadingStrategy innerStrategy;
22 * @param innerStrategy
24 public ArrayAttributeReadingStrategy(String nullableDefault, AttributeReadingStrategy innerStrategy) {
25 super(nullableDefault);
26 this.innerStrategy = innerStrategy;
30 AttributeConfigElement readElementHook(List<XmlElement> configNodes) {
31 List<Object> innerList = Lists.newArrayList();
32 for (int i = 0; i < configNodes.size(); i++) {
33 innerList.add(innerStrategy.readElement(Lists.newArrayList(configNodes.get(i))).getValue());
35 return AttributeConfigElement.create(getNullableDefault(), innerList);