Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5649

Allow the access specifier of the mutators to be configurable in the axis2 generated artifact classes

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.6.2
    • None
    • adb, codegen

    Description

      Right now, all the getters and setters getX and setX that operate on the instance variables localX are public in both the generated request and response classes.

      We'd like the access of the setters in the response objects at least to be private, preferably made configurable, so the users can specify their preferences via a new configuration parameter, say 'setterAccess' in the calling maven plugin. This would help maintain the immutability of the generated service response objects.

      Without this, we resort to hoping that the clients of these generated response classes won't modify the objects in a way we don't want them to.

      Typically, here's how a setter template looks in all of the *Template.xsl files in the axis2-adb-codegen:

      /**
      * Auto generated setter method
      * Overridden from <xsl:value-of select="$restriction"/>
      *
      * @param param <xsl:value-of select="$javaName"/>
      * @throws RuntimeException
      */
      private void set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$propertyType"/> param){
            throw new java.lang.RuntimeException();
      }
      

      We'd like the access specifier of these setters to be made configurable like many other attributes are.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            mystarrocks Sunil Veera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment