Permalink
Browse files

Updated isSet for enum

  • Loading branch information...
hovo1990 committed Jul 25, 2016
1 parent e55c0db commit 5cf5348deb4ddf89cd4a6b244e766f7e3f817b4a
@@ -292,6 +292,7 @@ def write_attribute_functions(self):
# self.write_function_implementation(code)
self.write_function_java(code)
# TODO enum as string?
# code = attrib_functions.write_get_string_for_enum(True, i)
# self.write_function_implementation(code)
@@ -727,7 +727,7 @@ def write_is_set(self, is_attribute, index):
# 'this {1}\'s \"{2}\" {3} is set.' \
# .format(self.true, self.object_name, attribute['name'],
# ob_type)
title_line = '@return '
# title_line = '@return '
if not self.is_java_api:
params.append('@param {0} the {1} structure.'
.format(self.abbrev_parent, self.object_name))
@@ -737,10 +737,10 @@ def write_is_set(self, is_attribute, index):
.format(self.true, self.object_name,
attribute['name'],
ob_type, self.false))
title_line = ''
params.append('Returns whether {{@link {0}}} is set.'.format(attribute['name']))
params.append(' ')
params.append('@return whether {{@link {0}}} is set.'.format(attribute['name']))
# create the function declaration
if self.is_java_api:
if 'isVector' in attribute and attribute['isVector']:
@@ -771,16 +771,18 @@ def write_is_set(self, is_attribute, index):
# create the function implementation
if self.is_java_api:
if query.is_string(attribute):
implementation = ['return {0} != null'.format(
implementation = ['return this.{0} != null'.format(
attribute['name'])] # USED
elif attribute['attType'] == 'enum' or attribute['isArray']:
implementation = ['return ({0} != '
'{1})'.format(attribute['name'],
attribute['default'])]
# implementation = ['return ({0} != '
# '{1})'.format(attribute['name'],
# attribute['default'])]
implementation = ['return this.{0} != null'.format(
attribute['name'])] # Used
elif query.has_is_set_member(attribute):
# implementation = ['return '
# 'mIsSet{0}'.format(attribute['capAttName'])]
implementation = ['return {0} != null'.format(
implementation = ['return this.{0} != null'.format(
attribute['name'])] # Used
elif attribute['type'] == 'element':
implementation = ['return ({0} != '
@@ -791,7 +793,7 @@ def write_is_set(self, is_attribute, index):
'> 0'.format(attribute['name'])]
else:
implementation = ['return {0} != null'.format(
implementation = ['return this.{0} != null'.format(
attribute['name'])] # USED
else:
if not self.is_list_of:

0 comments on commit 5cf5348

Please sign in to comment.