X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Fmapping%2Fattributes%2Fresolving%2FObjectResolver.java;fp=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Fmapping%2Fattributes%2Fresolving%2FObjectResolver.java;h=f1050b9df3a890f2e158da8f869d23cefd69427d;hp=c1eeef5cbfceedfb34928581143977fb09b254e1;hb=d266f4384d4850af9049d7cddd2bbac8f75ba61e;hpb=b197d75e803beac663033287d769dce62c108490 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..f1050b9df3 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, @@ -40,8 +40,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 +53,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 +64,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 +78,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 +87,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 +125,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); } - }