public class

TransactionData

extends ExtensionPoint
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.finance.TransactionData

Class Overview

Data for the transction.

Summary

Constants
String DATE XML "date" attribute name
String NOTES XML "notes" attribute name
String SHARES XML "shares" attribute name
String TYPE XML "type" attribute name
String XML_NAME XML element name
Fields
private DateTime date Date at which the transaction occurred
private String notes Notes
private Double shares Number of shares involved in the transaction
private String type Type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short")
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
TransactionData()
Default mutable constructor.
TransactionData(DateTime date, String notes, Double shares, String type)
Immutable constructor.
Public Methods
void declareExtensions(ExtensionProfile extProfile)
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
Commission getCommission()
Returns the commission for the transaction.
DateTime getDate()
Returns the date at which the transaction occurred.
static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
Returns the extension description, specifying whether it is required, and whether it is repeatable.
String getNotes()
Returns the notes.
Price getPrice()
Returns the price of the transaction.
Double getShares()
Returns the number of shares involved in the transaction.
String getType()
Returns the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
boolean hasCommission()
Returns whether it has the commission for the transaction.
boolean hasDate()
Returns whether it has the date at which the transaction occurred.
boolean hasNotes()
Returns whether it has the notes.
boolean hasPrice()
Returns whether it has the price of the transaction.
boolean hasShares()
Returns whether it has the number of shares involved in the transaction.
boolean hasType()
Returns whether it has the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
void setCommission(Commission commission)
Sets the commission for the transaction.
void setDate(DateTime date)
Sets the date at which the transaction occurred.
void setNotes(String notes)
Sets the notes.
void setPrice(Price price)
Sets the price of the transaction.
void setShares(Double shares)
Sets the number of shares involved in the transaction.
void setType(String type)
Sets the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String DATE

XML "date" attribute name

Constant Value: "date"

private static final String NOTES

XML "notes" attribute name

Constant Value: "notes"

private static final String SHARES

XML "shares" attribute name

Constant Value: "shares"

private static final String TYPE

XML "type" attribute name

Constant Value: "type"

static final String XML_NAME

XML element name

Constant Value: "transactionData"

Fields

private DateTime date

Date at which the transaction occurred

private String notes

Notes

private Double shares

Number of shares involved in the transaction

private String type

Type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short")

Public Constructors

public TransactionData ()

Default mutable constructor.

public TransactionData (DateTime date, String notes, Double shares, String type)

Immutable constructor.

Parameters
date Date at which the transaction occurred.
notes Notes.
shares Number of shares involved in the transaction.
type Type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Public Methods

public void declareExtensions (ExtensionProfile extProfile)

Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.

Parameters
extProfile The ExtensionProfile to initialize.

public Commission getCommission ()

Returns the commission for the transaction.

Returns
  • commission for the transaction

public DateTime getDate ()

Returns the date at which the transaction occurred.

Returns
  • date at which the transaction occurred

public static ExtensionDescription getDefaultDescription (boolean required, boolean repeatable)

Returns the extension description, specifying whether it is required, and whether it is repeatable.

Parameters
required Whether it is required
repeatable Whether it is repeatable
Returns
  • extension description

public String getNotes ()

Returns the notes.

Returns
  • notes

public Price getPrice ()

Returns the price of the transaction.

Returns
  • price of the transaction

public Double getShares ()

Returns the number of shares involved in the transaction.

Returns
  • number of shares involved in the transaction

public String getType ()

Returns the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Returns
  • type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short")

public boolean hasCommission ()

Returns whether it has the commission for the transaction.

Returns
  • whether it has the commission for the transaction

public boolean hasDate ()

Returns whether it has the date at which the transaction occurred.

Returns
  • whether it has the date at which the transaction occurred

public boolean hasNotes ()

Returns whether it has the notes.

Returns
  • whether it has the notes

public boolean hasPrice ()

Returns whether it has the price of the transaction.

Returns
  • whether it has the price of the transaction

public boolean hasShares ()

Returns whether it has the number of shares involved in the transaction.

Returns
  • whether it has the number of shares involved in the transaction

public boolean hasType ()

Returns whether it has the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Returns
  • whether it has the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short")

public void setCommission (Commission commission)

Sets the commission for the transaction.

Parameters
commission Commission for the transaction or null to reset

public void setDate (DateTime date)

Sets the date at which the transaction occurred.

Parameters
date Date at which the transaction occurred or null to reset

public void setNotes (String notes)

Sets the notes.

Parameters
notes Notes or null to reset

public void setPrice (Price price)

Sets the price of the transaction.

Parameters
price Price of the transaction or null to reset

public void setShares (Double shares)

Sets the number of shares involved in the transaction.

Parameters
shares Number of shares involved in the transaction or null to reset

public void setType (String type)

Sets the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Parameters
type Type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short") or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.