Class PasswordField


  • @JsonData
    public class PasswordField
    extends Field
    A field that allows the definition of a password.
    Since:
    taskplanner 3.0
    • Constructor Detail

      • PasswordField

        public PasswordField​(java.lang.String key,
                             java.lang.String label)
        Creates the field for setting a password
        Parameters:
        key - the key of the field
        label - the label to be displayed in front of the field
        Since:
        taskplanner 3.0
    • Method Detail

      • passwordFieldAsTextArea

        public static PasswordField passwordFieldAsTextArea​(java.lang.String key,
                                                            java.lang.String label,
                                                            java.lang.String placeholderIfValueSet)
        Creates the field for setting a password - as textarea, which displays the value only when being created
        Parameters:
        key - the key of the field
        label - the label to be displayed in front of the field
        placeholderIfValueSet - a placeholder for the case that there is a value already set
        Returns:
        the password field model
        Since:
        taskplanner 21.0
      • encodePassword

        public static java.lang.String encodePassword​(java.lang.String plainPassword)
                                               throws java.io.IOException
        Encodes the given plain password with an internal strong encryption
        Parameters:
        plainPassword - the password to be encrypted
        Returns:
        the encoded password
        Throws:
        java.io.IOException - if the encryption failed due to an error
        Since:
        taskplanner 3.0
      • decodePassword

        public static java.lang.String decodePassword​(java.lang.String encodedPassword)
                                               throws java.io.IOException
        Decodes the given encrypted password and returns the plain string
        Parameters:
        encodedPassword - the encrypted password to be decoded
        Returns:
        the decoded password
        Throws:
        java.io.IOException - if the decryption failed due to an error
        Since:
        taskplanner 3.0