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 com.google.common.collect.Maps;
14 import java.util.List;
17 public class SimpleUnionAttributeReadingStrategy extends SimpleAttributeReadingStrategy {
19 private final String key;
21 public SimpleUnionAttributeReadingStrategy(String nullableDefault, String key) {
22 super(nullableDefault);
26 protected Object postprocessParsedValue(String textContent) {
27 char[] charArray = textContent.toCharArray();
28 List<String> chars = Lists.newArrayListWithCapacity(charArray.length);
30 for (char c : charArray) {
31 chars.add(Character.toString(c));
34 Map<String, Object> map = Maps.newHashMap();
40 protected Object postprocessNullableDefault(String nullableDefault) {
41 return nullableDefault == null ? null : postprocessParsedValue(nullableDefault);