X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Fmapping%2Fattributes%2Fresolving%2FObjectResolver.java;h=4fcdc1298cc9f3ea51c044729d4dc9827f2a3389;hb=f43b01b81319959b1907e3e04537f5169e7f33d8;hp=c1eeef5cbfceedfb34928581143977fb09b254e1;hpb=e331fa568ee0b7a33ec451a104123bcbf7d86e78;p=controller.git diff --git a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ObjectResolver.java b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ObjectResolver.java index c1eeef5cbf..4fcdc1298c 100644 --- a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ObjectResolver.java +++ b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ObjectResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2015, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -33,6 +33,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement>> prepareResolving( final Map configDefinition, final EnumResolver enumResolver) { this.enumResolver = enumResolver; @@ -40,8 +41,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement>> strategies = Maps.newHashMap(); for (Entry attrEntry : configDefinition.entrySet()) { - strategies.put(attrEntry.getKey(), - prepareStrategy(attrEntry.getValue())); + strategies.put(attrEntry.getKey(), prepareStrategy(attrEntry.getValue())); } return strategies; @@ -54,7 +54,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement createYangToJmxMapping(final TOAttribute attributeIfc) { Map retVal = Maps.newHashMap(); for (Entry entry : attributeIfc.getYangPropertiesToTypesMap().entrySet()) { - retVal.put(entry.getKey(), (entry.getValue()).getLowerCaseCammelCase()); + retVal.put(entry.getKey(), entry.getValue().getLowerCaseCammelCase()); } return retVal; } @@ -65,12 +65,13 @@ public class ObjectResolver extends AttributeIfcSwitchStatement> caseJavaSimpleAttribute(final SimpleType openType) { + protected AttributeResolvingStrategy> caseJavaSimpleAttribute( + final SimpleType openType) { return new SimpleAttributeResolvingStrategy(openType); } @Override - protected AttributeResolvingStrategy> caseJavaArrayAttribute(final ArrayType openType) { + protected AttributeResolvingStrategy> caseJavaArrayAttribute(final ArrayType openType) { SimpleType innerType = (SimpleType) openType.getElementOpenType(); AttributeResolvingStrategy> strat = new SimpleAttributeResolvingStrategy(innerType); @@ -78,7 +79,8 @@ public class ObjectResolver extends AttributeIfcSwitchStatement> caseJavaCompositeAttribute(final CompositeType openType) { + protected AttributeResolvingStrategy> caseJavaCompositeAttribute( + final CompositeType openType) { Map>> innerMap = Maps.newHashMap(); Map yangToJmxMapping = Maps.newHashMap(); @@ -86,7 +88,9 @@ public class ObjectResolver extends AttributeIfcSwitchStatement>> innerMap, final Map yangToJmxMapping) { + private void fillMappingForComposite(final CompositeType openType, + final Map>> innerMap, + final Map yangToJmxMapping) { for (String innerAttributeKey : openType.keySet()) { innerMap.put(innerAttributeKey, caseJavaAttribute(openType.getType(innerAttributeKey))); yangToJmxMapping.put(innerAttributeKey, innerAttributeKey); @@ -122,8 +126,7 @@ public class ObjectResolver extends AttributeIfcSwitchStatement> caseListDependeciesAttribute(final ArrayType openType) { + protected AttributeResolvingStrategy> caseListDependeciesAttribute( + final ArrayType openType) { Preconditions.checkState(getLastAttribute() instanceof ListDependenciesAttribute); return new ArrayAttributeResolvingStrategy(caseDependencyAttribute(SimpleType.OBJECTNAME), openType); } - }