2 * Copyright (c) 2015 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.config.facade.xml.mapping.attributes.toxml;
11 import java.util.List;
12 import org.opendaylight.controller.config.facade.xml.util.Util;
13 import org.w3c.dom.Element;
15 public class ArrayAttributeWritingStrategy implements AttributeWritingStrategy {
17 private final AttributeWritingStrategy innnerStrategy;
19 public ArrayAttributeWritingStrategy(final AttributeWritingStrategy innerStrategy) {
20 this.innnerStrategy = innerStrategy;
24 public void writeElement(final Element parentElement, final String namespace, final Object value) {
25 Util.checkType(value, List.class);
27 for (Object innerObject : ((List<?>) value)) {
28 innnerStrategy.writeElement(parentElement, namespace, innerObject);