at.knowcenter.wag.egov.egiz.sig
Class SignatureDataImpl

java.lang.Object
  extended byat.knowcenter.wag.egov.egiz.sig.SignatureDataImpl
All Implemented Interfaces:
Serializable, SignatureData

public class SignatureDataImpl
extends Object
implements SignatureData, Serializable

Generic implementation of the SignatureData interface for being used by signators and verificators.

Author:
wprinz
See Also:
Serialized Form

Field Summary
protected  String characterEncoding
          The character encoding of the data if appropriate, or null if not.
protected  DataSource data
          The signature data.
protected  String mimeType
          The mime type of the data.
 
Constructor Summary
SignatureDataImpl(DataSource data, String mime_type)
          Constructor that fills the SignatureData.
SignatureDataImpl(DataSource data, String mime_type, String character_encoding)
           
 
Method Summary
 String getCharacterEncoding()
          Returns the character encoding (charset) of the data if appropriate.
 DataSource getDataSource()
          Returns the DataSource that provides the data for this SignatureData.
 String getMimeType()
          Returns the mime type of the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected DataSource data
The signature data.


mimeType

protected String mimeType
The mime type of the data.


characterEncoding

protected String characterEncoding
The character encoding of the data if appropriate, or null if not.

Constructor Detail

SignatureDataImpl

public SignatureDataImpl(DataSource data,
                         String mime_type)
Constructor that fills the SignatureData.

The charactor encoding is set to null, so this constructor is primarily for signature data that has no character encoding (e.g. binary data).

Parameters:
data - The signature data.
mime_type - The mime type of the data.

SignatureDataImpl

public SignatureDataImpl(DataSource data,
                         String mime_type,
                         String character_encoding)
Method Detail

getDataSource

public DataSource getDataSource()
Description copied from interface: SignatureData
Returns the DataSource that provides the data for this SignatureData.

Specified by:
getDataSource in interface SignatureData
Returns:
Returns the DataSource.
See Also:
SignatureData.getDataSource()

getMimeType

public String getMimeType()
Description copied from interface: SignatureData
Returns the mime type of the data.

E.g. "text/plain" for text data or "application/pdf" for a PDF.

Specified by:
getMimeType in interface SignatureData
Returns:
Returns the mime type of the data.
See Also:
SignatureData.getMimeType()

getCharacterEncoding

public String getCharacterEncoding()
Description copied from interface: SignatureData
Returns the character encoding (charset) of the data if appropriate.

This is only appropriate if the mime type suggests that the data contained in here is textually encoded. Usually text/plain or similar data types will have a character encoding present.

If no character encoding is present, null is returned here.

E.g. "UTF-8" is the most common encoding for textual data.

Specified by:
getCharacterEncoding in interface SignatureData
Returns:
Returns the character encoding (charset) of the data if appropriate.
See Also:
SignatureData.getCharacterEncoding()


Copyright © 2006-2010. All Rights Reserved.