- protected AttributeReadingStrategy caseTOAttribute(TOAttribute attributeIfc) {
- Map<String, AttributeIfc> inner = attributeIfc.getYangPropertiesToTypesMap();
+ public AttributeReadingStrategy caseJavaSimpleAttribute(SimpleType<?> openType) {
+ return new SimpleAttributeReadingStrategy(lastAttribute.getNullableDefault());
+ }
+
+ @Override
+ public AttributeReadingStrategy caseJavaArrayAttribute(ArrayType<?> openType) {
+ SimpleAttributeReadingStrategy innerStrategy = new SimpleAttributeReadingStrategy(lastAttribute.getNullableDefault());
+ return new ArrayAttributeReadingStrategy(lastAttribute.getNullableDefault(), innerStrategy);
+ }
+
+ @Override
+ public AttributeReadingStrategy caseJavaCompositeAttribute(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(lastAttribute.getNullableDefault(), mappingKey);
+ }
+
+ @Override
+ protected AttributeReadingStrategy caseDependencyAttribute(SimpleType<?> openType) {
+ return new ObjectNameAttributeReadingStrategy(lastAttribute.getNullableDefault());
+ }
+
+ @Override
+ protected AttributeReadingStrategy caseTOAttribute(CompositeType openType) {
+ Preconditions.checkState(lastAttribute instanceof TOAttribute);
+ Map<String, AttributeIfc> inner = ((TOAttribute)lastAttribute).getYangPropertiesToTypesMap();
+