def parse_type(field):
if field.type_id == '<STR_LIT:string>':<EOL><INDENT>if '<STR_LIT:size>' in field.options:<EOL><INDENT>return "<STR_LIT>" % field.options['<STR_LIT:size>'].value<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT><DEDENT>elif field.type_id in JAVA_TYPE_MAP:<EOL><INDENT>return "<STR_LIT>" + field.type_id.capitalize() + "<STR_LIT>"<EOL><DEDENT>if field.type_id == '<STR_LIT>':<EOL><INDENT>t = field.options['<STR_LIT>'].value<EOL>if t in JAVA_TYPE_MAP:<EOL><INDENT>if '<STR_LIT:size>' in field.options:<EOL><INDENT>return "<STR_LIT>" % (t.capitalize(), field.options['<STR_LIT:size>'].value)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>" % t.capitalize()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if '<STR_LIT:size>' in field.options:<EOL><INDENT>return "<STR_LIT>" % (t, field.options['<STR_LIT:size>'].value)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>" % t<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>return "<STR_LIT>" % field.type_id<EOL><DEDENT>
Function to pull a type from the binary payload.