#NEWLINE# @ classmethod #NEWLINE# def factory( cls , data ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# cm = CLASS_MAP [ cls . __name__ ] #NEWLINE# for key in data : #NEWLINE# #INDENT# if ( ( key in cm ) and isinstance ( data [ key ] , list ) ) : #NEWLINE# #INDENT# l = [ ] #NEWLINE# for d in data [ key ] : #NEWLINE# #INDENT# l . append ( JsonObjectFactory . create ( cm [ key ] , d ) ) #NEWLINE# #UNINDENT# data [ key ] = l #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key in cm ) : #NEWLINE# #INDENT# data [ key ] = JsonObjectFactory . create ( cm [ key ] , data [ key ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return cls ( ** data )