def walkValue(self, value, type_): # ugh, must switch on type here; can't use polymorphism if AttributeReflectionController.isAtomicType(type_): self.walkAtomicType(type_) elif type_ == stringtemplate.StringTemplate: self.walkStringTemplate(value) elif ASTExpr.isValidDictInstance(type_): self.walkMap(value) else: self.walkPropertiesList(value, type_)
self.output.write('Property ' + propName + ' : ') if not returnType or returnType == type(None): self.output.write('<any>') elif instanceReturnType: self.output.write(instanceReturnType.__name__) else: self.output.write(returnType.__name__) self.output.write('\n') # get actual return type for get methods for STs or for Maps; otherwise type is enough if returnType == stringtemplate.StringTemplate: self.indentation += 1 self.walkStringTemplate(self.getRawValue(aggregateValue, methodName)) self.indentation -= 1 elif ASTExpr.isValidReturnTypeDictInstance(returnType): rawMap = self.getRawValue(aggregateValue, methodName) # if valid map instance, show key/values # otherwise don't descend if rawMap and ASTExpr.isValidDictInstance(type(rawMap)): self.indentation += 1 self.walkValue(rawMap, type(rawMap)) self.indentation -= 1 elif not AttributeReflectionController.isAtomicType(returnType): self.indentation += 1 self.walkValue(None, returnType) self.indentation -= 1 self.restoreItemIndex() def walkValue(self, value, type_): # ugh, must switch on type here; can't use polymorphism