axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Dick (JIRA)" <>
Subject [jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do
Date Thu, 03 Feb 2005 11:32:17 GMT
     [ ]
Adrian Dick commented on AXISCPP-228:

Fixing this issue could provide a (simpler) mechanism to support xsd:choice and validating
minOccurs and MaxOccurs, it may also provide a neater solution for handling nillable elements.

Current Jira Issues in this area include: AXISCPP-250 and AXISCPP-257.

To support xsd:choice
- An enum is created containing all possible choices.
- The generated class contains a union of the elements available within the choice, and a
tag for the enum.
- set<...> methods are provided for all possible choices, each will set the approiate
element, and update tag for the given choice.
- get<...> methods are provided for all possible choices, and a getChoiceType method,
returning the tag, allowing customer code to use correct get<...> method.

typedef enum { CHOICE1=1, CHOICE2=1} availableChoices;
class ChoiceWrapper
 void setChoice1(... value)
  choice1 = value;
  choice = CHOICE1;
 void setChoice2(... value);
 ... getChoice1();
 ... getChoice2()
 { return choice2; };
 availableChoices getChoice()
 { return choice; };
 availableChoices choice = 0;
  ... choice1;
  ... choice2;
 } choices;

To support minOccurs and MaxOccurs:
- If maxOccurs > 1, provide an add<...> method, which when called will update a count
of occurances of elements.
- If maxOccurs = 1, can do as above, or alternatively, provide a set<...> method, again
updating a count of elements.
- Provide a <...>Occurances method, to allow customers to determine how many element
they have.

class OccurancesWrapper
 addValue(... addValue)
  if (valueOccurances != valueMaxOccurs)
   value[valueOccurances] = addValue;
    throw new AxisException(EXCEEDING_MAX_OCCURS);
 int getValueOccurances()
 { return valueOccurances; };
 ... getValue(int occurance)
 { return value[occurance]; };
 ... value[valueMaxOccurances];
 int valueOccurances = 0;
 const int valueMaxOccurs = 2;
 const int valueMinOccurs = 0;
 // ...
 if ( valueOccurances < valueMinOccurs)
   throw new AxisException(LESS_THAN_MIN_OCCURS);
 if (valueOccurances != 0)
 // ...

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>          Key: AXISCPP-228
>          URL:
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Samisa Abeysinghe
>     Priority: Minor

> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can
generate getter and setter methods for the data members the same way as the Java version does

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message