@access

May 18, 2022 0 Comments

Syntax

@access <private|protected|public>

Overview

The @access tag specifies the access level of a member. Note that “@access private” is the same as “@private”, “@access protected” is the same as “@protected”, and “@access public” is the same as “@public” which is the same as not including the tag at all. Private members will not show in the output documentation unless JSDoc is given the --private option.

Note that a doclet’s access level is different from its scope. For example, if “Parent” has an inner variable “child” that is documented as @public, “child” will still be treated as an inner variable with the namepath “Parent~child”. To change a doclet’s scope, see the @instance, @static, and @global tags.

Examples

@access is a synonym for @private, @protected, @public.
/** @constructor */
function Thingy() {

    /** @access private */
    var foo = 0;

    /** @access protected */
    this._bar = 1;

    /** @access public */
    this.pez = 2;

}

// same as...

/** @constructor */
function OtherThingy() {

    /** @private */
    var foo = 0;

    /** @protected */
    this._bar = 1;

    /** @public */
    this.pez = 2;

}

See Also

  • @private and the –private command-line option.
  • @protected
  • @public
  • @instance, @static and @global for modifying the scope of a doclet.