com.groupdocs.editor.options

Class WorksheetProtection



  • public final class WorksheetProtection
    extends Object

    Encapsulates worksheet protection options, which allow to protect a worksheet in the output Spreadsheet document from modification of specified type with a specified password.


    Most of Spreadsheet formats like XLSX allows to protect a worksheet from editing with password. This class allows to enable such protection and specify its options.
    • Constructor Detail

      • WorksheetProtection

        public WorksheetProtection()

        Creates new instance with default parameters. If not modified and passed to SpreadsheetSaveOptions, no worksheet protection will be applied

      • WorksheetProtection

        public WorksheetProtection(byte protectionType,
                                   String password)

        Creates new instance with specified worksheet protection type and password

        Parameters:
        protectionType - Type of worksheet protection
        password - Password, that locks the protection
    • Method Detail

      • getPassword

        public final String getPassword()

        Password, which is used for protecting a worksheet. If NULL or empty string, the protection will not be applied.

      • getProtectionType

        public final byte getProtectionType()

        Allows to specify a type of worksheet protection. By default is 'None' - protection is not applied.

      • setPassword

        public final void setPassword(String value)

        Password, which is used for protecting a worksheet. If NULL or empty string, the protection will not be applied.

      • setProtectionType

        public final void setProtectionType(byte value)

        Allows to specify a type of worksheet protection. By default is 'None' - protection is not applied.