Class PasswordProp

  • All Implemented Interfaces:
    EventListener, IGProp<java.lang.String>, java.lang.Cloneable

    public class PasswordProp
    extends StringProp
    The Password property class hold a password that is encrypted when stored to media.
    Author:
    Christopher Mindus
    • Constructor Detail

      • PasswordProp

        protected PasswordProp()
        Creates a Password property with no name and with a null value.
      • PasswordProp

        public PasswordProp​(Atom propertyAtom)
        Creates a Password property with the specified name with a null value.
        Parameters:
        propertyAtom - the property atom.
      • PasswordProp

        public PasswordProp​(Atom propertyAtom,
                            java.lang.String password)
                     throws PropValidateException
        Creates a Password property with the specified name and value.
        Parameters:
        propertyAtom - the property atom.
        password - the password.
        Throws:
        PropValidateException - When the constraints are not met.
    • Method Detail

      • appendPropValue

        protected void appendPropValue​(PropMgr propertyManager,
                                       SendTransaction trans,
                                       java.lang.Object value)
        Appends the string property value. If uninitialized, an empty string is appended.
        Overrides:
        appendPropValue in class StringProp
        Parameters:
        propertyManager - the property manager instance.
        trans - transaction to append the properties to.
        value - the value to append to the transaction, a reference to the current property value.
      • initializeValue

        public boolean initializeValue​(PropMgr propertyManager,
                                       ReadTransaction trans)
                                throws PropException
        Initializes the property value from a transaction.
        Overrides:
        initializeValue in class StringProp
        Parameters:
        propertyManager - the property manager.
        trans - the transaction to initialize the property with.
        Returns:
        true if the value has changed, false otherwise.
        Throws:
        PropException
      • toElementString

        public java.lang.String toElementString​(java.lang.Object value)
        Called from the initializeElement(Element element) method. Override this method to provide the appropriate Object to String conversion.

        The default implementation returns the Object value.toString() return code. If the value is null, null is returned.

        Specified by:
        toElementString in interface IGProp<java.lang.String>
        Overrides:
        toElementString in class GProp<java.lang.String>
        Parameters:
        value - the value in the object to convert to a string.
        Returns:
        the string corresponding to the object value, or null for a null value.
      • fromElementString

        public java.lang.Object fromElementString​(java.lang.String string)
        Called from the initializeProperty(Element element) method once the element String is retrieved from the "value" attribute of the element. Override this method to provide the appropriate String to Object conversion.

        The default implementation returns the String passed as the parameter.

        Specified by:
        fromElementString in interface IGProp<java.lang.String>
        Overrides:
        fromElementString in class GProp<java.lang.String>
        Parameters:
        string - the String value of the object from the String value attribute.
        Returns:
        the Object in "native" property value form of the string value.