com.groupdocs.signature.domain.signatures.metadata

Class MetadataSignature

    • Constructor Detail

      • MetadataSignature

        protected MetadataSignature(String name)

        Creates Metadata Signature with predefined name and empty value

        Parameters:
        name - Metadata name
      • MetadataSignature

        protected MetadataSignature(String name,
                                    Object value)

        Creates Metadata Signature with predefined values

        Parameters:
        name - Name of Metadata signature object
        value - Value of Metadata signature
    • Method Detail

      • deepClone

        public Object deepClone()

        Clone Metadata Signature instance.

        Overrides:
        deepClone in class BaseSignature
        Returns:
        Returns cloned Metadata Signature instance
      • deepClone

        public MetadataSignature deepClone(Object value)

        Clone Metadata Signature instance with given value.

        Parameters:
        value - Value for new cloned object.
        Returns:
        Returns cloned Metadata Signature instance with given value.
      • equals

        public boolean equals(Object signature)

        Overwrites Equals method to compare signature properties

        Overrides:
        equals in class BaseSignature
        Parameters:
        signature - Signature object to compare with.
        Returns:
        Returns true if passed signature object has same type and all its properties are equal to this instance properties.
      • getData

        public final <T> T getData(Class<T> typeOfT)
                            throws Exception

        Obtain object from Metadata Signature Value over deserialization.

        Returns:
        Instance of T object

        T: Type of object to deserialize from Metadata value

        Throws:
        Exception
      • getData

        public final <T> T getData(Class<T> typeOfT,
                                   IDataEncryption dataEncryption)
                            throws Exception

        Obtain object from Metadata Signature Text over deserialization.

        Parameters:
        dataEncryption - Set custom data encryption implementation

        T: Type of object to deserialize from Metadata Value

        Returns:
        Throws:
        Exception
      • getDataEncryption

        public final IDataEncryption getDataEncryption()

        Gets or sets implementation of IDataEncryption interface to encode and decode signature Value properties.

      • getFValue

        protected final Object getFValue()

        Protected Metadata object value

      • getName

        public final String getName()

        Specifies unique metadata name.

      • getType

        public final int getType()

        Specifies metadata value type.

      • getValue

        public final Object getValue()

        Specifies metadata object.

      • hashCode

        public int hashCode()

        Overrides GetHashCode method

        Overrides:
        hashCode in class BaseSignature
        Returns:
        Signature hash code
      • setDataEncryption

        public final void setDataEncryption(IDataEncryption value)

        Gets or sets implementation of IDataEncryption interface to encode and decode signature Value properties.

      • setFValue

        protected final void setFValue(Object value)

        Protected Metadata object value

      • setName

        public final void setName(String value)

        Specifies unique metadata name.

      • setType

        public final void setType(int value)

        Specifies metadata value type.

      • setValue

        public final void setValue(Object value)

        Specifies metadata object.

      • SetValue

        protected void SetValue(Object value)

        Implements virtual method of setting value into metadata signature

        Parameters:
        value - Given metadata value
      • toBoolean

        public boolean toBoolean()
                          throws Exception

        Converts to boolean.

        Returns:
        Returns the Metadata signature value as boolean.


        Throws an exception if the Metadata value could not be converted.
        Throws:
        Exception
      • toDateTime

        public Date toDateTime()
                        throws Exception

        Converts to DateTime.

        Returns:
        Returns the Metadata Signature value as DateTime.


        Throws an exception if the Metadata value could not be converted. If original value is string based the default culture property info will be used from SignatureSettings properties SignatureSettings.DefaultCulture
        Throws:
        Exception
      • toDateTime

        public Date toDateTime(Locale provider)
                        throws Exception

        Converts to DateTime.

        Parameters:
        provider - Format data provider to use with data conversion operations.


        Throws an exception if the Metadata value could not be converted
        Returns:
        Returns the Metadata Signature value as DateTime.
        Throws:
        Exception
      • toDouble

        public double toDouble()
                        throws Exception

        Converts to Double.

        Returns:
        Returns the Metadata Signature value as Double.


        Throws an exception if the Metadata value could not be converted. If original value is string based the default culture property info will be used from SignatureSettings properties SignatureSettings.DefaultCulture
        Throws:
        Exception
      • toDouble

        public double toDouble(Locale provider)
                        throws Exception

        Converts to Double.

        Parameters:
        provider - Format data provider to use with data conversion operations.


        Throws an exception if the Metadata value could not be converted
        Returns:
        Returns the Metadata Signature value as Double.
        Throws:
        Exception
      • toInteger

        public int toInteger()
                      throws Exception

        Converts to integer.

        Returns:
        Returns the Metadata Signature value as integer.


        Throws an exception if the Metadata value could not be converted.
        Throws:
        Exception
      • toSingle

        public float toSingle()
                       throws Exception

        Converts to float.

        Returns:
        Returns the Metadata Signature value as float.


        Throws an exception if the Metadata value could not be converted. If original value is string based the default culture property info will be used from SignatureSettings properties SignatureSettings.DefaultCulture()
        Throws:
        Exception
      • toSingle

        public float toSingle(Locale provider)
                       throws Exception

        Converts to float.

        Parameters:
        provider - Format data provider to use with data conversion operations.


        Throws an exception if the Metadata value could not be converted
        Returns:
        Returns the Metadata Signature value as float.
        Throws:
        Exception
      • toString

        public String toString()

        Converts to String with override ToString() method

        Overrides:
        toString in class BaseSignature
        Returns:
        Returns the Metadata Signature value as String.


        Converts a boolean property into "True" or "False". For another data type the default data format provider will be used.
      • toString

        public String toString(String format)
                        throws Exception

        Converts to String with specified format

        Parameters:
        format - Data format string.


        Converts a boolean property into "True" or "False". Default culture property info will be used from SignatureSettings properties SignatureSettings.DefaultCulture
        Returns:
        Returns the Metadata Signature value as String.
        Throws:
        Exception
      • toString

        public String toString(String format,
                               Locale provider)
                        throws Exception

        Converts to String with specified format

        Parameters:
        format - Data format string.
        provider - Format data provider to use with data conversion operations.


        Converts a boolean property into "True" or "False".
        Returns:
        Returns the Metadata Signature value as String.
        Throws:
        Exception