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%2Ffromxml%2FObjectXmlReader.java;h=2fe373475fa601dfe93df688a6910e2d48b83624;hp=a9c07238692de2d75ebb2fa171bcb820d6cf6c3c;hb=e331fa568ee0b7a33ec451a104123bcbf7d86e78;hpb=cbcc2b61265e903959f11d44c292771e76b3926e diff --git a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ObjectXmlReader.java b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ObjectXmlReader.java index a9c0723869..2fe373475f 100644 --- a/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ObjectXmlReader.java +++ b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/ObjectXmlReader.java @@ -31,7 +31,7 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement> identityMap; - public Map prepareReading(Map yangToAttrConfig, Map> identityMap) { + public Map prepareReading(final Map yangToAttrConfig, final Map> identityMap) { Map strategies = Maps.newHashMap(); this.identityMap = identityMap; @@ -42,42 +42,42 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement openType) { + protected AttributeReadingStrategy caseJavaBinaryAttribute(final OpenType openType) { return new SimpleBinaryAttributeReadingStrategy(getLastAttribute().getNullableDefault()); } @Override - protected AttributeReadingStrategy caseJavaUnionAttribute(OpenType openType) { + protected AttributeReadingStrategy caseJavaUnionAttribute(final OpenType openType) { String mappingKey = JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION; return new SimpleUnionAttributeReadingStrategy(getLastAttribute().getNullableDefault(), mappingKey); } @Override - public AttributeReadingStrategy caseJavaSimpleAttribute(SimpleType openType) { + public AttributeReadingStrategy caseJavaSimpleAttribute(final SimpleType openType) { return new SimpleAttributeReadingStrategy(getLastAttribute().getNullableDefault()); } @Override - public AttributeReadingStrategy caseJavaArrayAttribute(ArrayType openType) { + public AttributeReadingStrategy caseJavaArrayAttribute(final ArrayType openType) { SimpleAttributeReadingStrategy innerStrategy = new SimpleAttributeReadingStrategy(getLastAttribute().getNullableDefault()); return new ArrayAttributeReadingStrategy(getLastAttribute().getNullableDefault(), innerStrategy); } @Override - public AttributeReadingStrategy caseJavaCompositeAttribute(CompositeType openType) { + public AttributeReadingStrategy caseJavaCompositeAttribute(final CompositeType openType) { Preconditions.checkState(openType.keySet().size() == 1, "Unexpected number of elements for open type %s, should be 1", openType); String mappingKey = openType.keySet().iterator().next(); return new SimpleCompositeAttributeReadingStrategy(getLastAttribute().getNullableDefault(), mappingKey); } @Override - protected AttributeReadingStrategy caseJavaIdentityRefAttribute(OpenType openType) { + protected AttributeReadingStrategy caseJavaIdentityRefAttribute(final OpenType openType) { Preconditions.checkState(openType instanceof CompositeType); Set keys = ((CompositeType) openType).keySet(); Preconditions.checkState(keys.size() == 1, "Unexpected number of elements for open type %s, should be 1", openType); @@ -86,12 +86,12 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement openType) { + protected AttributeReadingStrategy caseDependencyAttribute(final SimpleType openType) { return new ObjectNameAttributeReadingStrategy(getLastAttribute().getNullableDefault()); } @Override - protected AttributeReadingStrategy caseTOAttribute(CompositeType openType) { + protected AttributeReadingStrategy caseTOAttribute(final CompositeType openType) { AttributeIfc lastAttribute = getLastAttribute(); Preconditions.checkState(lastAttribute instanceof TOAttribute); Map inner = ((TOAttribute)lastAttribute).getYangPropertiesToTypesMap(); @@ -108,7 +108,7 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement openType) { + protected AttributeReadingStrategy caseListAttribute(final ArrayType openType) { AttributeIfc lastAttribute = getLastAttribute(); Preconditions.checkState(lastAttribute instanceof ListAttribute); AttributeReadingStrategy innerStrategy = prepareReadingStrategy(key, ((ListAttribute) lastAttribute).getInnerAttribute()); @@ -116,7 +116,7 @@ public class ObjectXmlReader extends AttributeIfcSwitchStatement openType) { + protected AttributeReadingStrategy caseListDependeciesAttribute(final ArrayType openType) { AttributeIfc lastAttribute = getLastAttribute(); Preconditions.checkState(lastAttribute instanceof ListDependenciesAttribute); AttributeReadingStrategy innerStrategy = caseDependencyAttribute(SimpleType.OBJECTNAME);