|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FIM.payment.PaymentBase | +--FIM.payment.DataPayment
A class representing the payment by providing some valuable piece of data. This could be either some kind of E-Cash or replacing the purchase with an exchange (data-for-data). The data can be one of the following:
Invoice
, Serialized FormField Summary | |
static int |
TYPE_BYTES
The type of the content: Array of bytes |
static int |
TYPE_EMPTY
The type of the content: NONE |
static int |
TYPE_SERIALIZABLE
The type of the content: Serializable object |
static int |
TYPE_STRING
The type of the content: String |
Constructor Summary | |
DataPayment()
Create a new empty object. |
|
DataPayment(Element elem)
Create a new data payment from an XML element. |
|
DataPayment(Invoice inv,
String characteristic,
byte[] byteData)
Create a new data payment with the type array of bytes. |
|
DataPayment(Invoice inv,
String characteristic,
Serializable serialData)
Create a new data payment with the type serializable object. |
|
DataPayment(Invoice inv,
String characteristic,
String stringData)
Create a new data payment with the type string. |
Method Summary | |
void |
decodeXMLElement(Element elem)
Parse back the payment from an XML element. |
Element |
getAsXMLElement(Document doc)
Retrieve the payment as an XML element. |
byte[] |
getByteData()
Retrieve the data in case of the bytes variant. |
byte[] |
getEncoded()
Retrieve the payment in encoded form to be used for signing. |
Serializable |
getSerializableData()
Retrieve the data in case of the serializable object variant. |
String |
getStringData()
Retrieve the data in case of the string variant. |
int |
getType()
Retrieve the type of this payment. |
String |
toString()
Retrieve the payment as a string, suitable for presenting to the user in a very simple form. |
Methods inherited from class FIM.payment.PaymentBase |
characteristics, getAsSerializable, getCertificate, getInvoice, isSigned, sign, verifySignature, verifySignature |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int TYPE_EMPTY
public static final int TYPE_STRING
public static final int TYPE_BYTES
public static final int TYPE_SERIALIZABLE
Constructor Detail |
public DataPayment()
public DataPayment(Invoice inv, String characteristic, String stringData)
invoice
- the invoice this payment is forcharacteristic
- the description of the contentstringData
- the string datapublic DataPayment(Invoice inv, String characteristic, byte[] byteData)
invoice
- the invoice this payment is forcharacteristic
- the description of the contentbyteData
- the byte datapublic DataPayment(Invoice inv, String characteristic, Serializable serialData)
invoice
- the invoice this payment is forcharacteristic
- the description of the contentserialData
- the serializable objectpublic DataPayment(Element elem)
elem
- the XML element containing the encoded formMethod Detail |
public String getStringData()
IllegalStateException
- if this object ist not of the data subtype or not initializedpublic byte[] getByteData()
IllegalStateException
- if this object ist not of the byte-array subtype or not initializedpublic Serializable getSerializableData()
IllegalStateException
- if this object ist not of the serializable object subtype or not initializedpublic int getType()
TYPE_EMPTY
,
TYPE_STRING
,
TYPE_BYTES
,
TYPE_SERIALIZABLE
public String toString()
toString
in class Object
public byte[] getEncoded()
getEncoded
in class PaymentBase
public Element getAsXMLElement(Document doc)
getAsXMLElement
in class PaymentBase
doc
- the document within which to create the elementpublic void decodeXMLElement(Element elem) throws IllegalArgumentException
decodeXMLElement
in class PaymentBase
elem
- the element containing the currency to parse backIllegalArgumentException
- if the element is incorrect (e. g. wrong tag name)
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |