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.toxml;
11 import java.util.List;
13 import org.opendaylight.controller.netconf.confignetconfconnector.util.Util;
14 import org.w3c.dom.Element;
16 public class ArrayAttributeWritingStrategy implements AttributeWritingStrategy {
18 private final AttributeWritingStrategy innnerStrategy;
20 public ArrayAttributeWritingStrategy(AttributeWritingStrategy innerStrategy) {
21 this.innnerStrategy = innerStrategy;
25 public void writeElement(Element parentElement, String namespace, Object value) {
26 Util.checkType(value, List.class);
28 for (Object innerObject : ((List<?>) value)) {
29 innnerStrategy.writeElement(parentElement, namespace, innerObject);