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.fromxml;
11 import com.google.common.collect.Maps;
12 import java.util.HashMap;
14 public class SimpleCompositeAttributeReadingStrategy extends SimpleAttributeReadingStrategy {
16 private final String key;
18 public SimpleCompositeAttributeReadingStrategy(final String nullableDefault, final String key) {
19 super(nullableDefault);
24 protected Object postprocessParsedValue(final String textContent) {
25 HashMap<String,String> map = Maps.newHashMap();
26 map.put(key, textContent);
31 protected Object postprocessNullableDefault(final String nullableDefault) {
32 return nullableDefault == null ? null : postprocessParsedValue(nullableDefault);