Google Data APIs Client Library (1.41.1)



com.google.gdata.data.finance
Class TransactionData

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.finance.TransactionData
All Implemented Interfaces:
Extension

public class TransactionData
extends ExtensionPoint

Data for the transction.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
TransactionData()
          Default mutable constructor.
TransactionData(DateTime date, java.lang.String notes, java.lang.Double shares, java.lang.String type)
          Immutable constructor.
 
Method Summary
protected  void consumeAttributes(AttributeHelper helper)
          Consumes attributes from the attribute helper.
 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.
 java.lang.String getNotes()
          Returns the notes.
 Price getPrice()
          Returns the price of the transaction.
 java.lang.Double getShares()
          Returns the number of shares involved in the transaction.
 java.lang.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").
protected  void putAttributes(AttributeGenerator generator)
          Puts attributes into the attribute generator.
 void setCommission(Commission commission)
          Sets the commission for the transaction.
 void setDate(DateTime date)
          Sets the date at which the transaction occurred.
 void setNotes(java.lang.String notes)
          Sets the notes.
 void setPrice(Price price)
          Sets the price of the transaction.
 void setShares(java.lang.Double shares)
          Sets the number of shares involved in the transaction.
 void setType(java.lang.String type)
          Sets the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
 java.lang.String toString()
           
protected  void validate()
          Checks the attributes to see if there are any problems.
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren
 
Methods inherited from class com.google.gdata.data.AbstractExtension
disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionData

public TransactionData()
Default mutable constructor.


TransactionData

public TransactionData(DateTime date,
                       java.lang.String notes,
                       java.lang.Double shares,
                       java.lang.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").
Method Detail

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Description copied from class: ExtensionPoint
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.

Overrides:
declareExtensions in class ExtensionPoint
Parameters:
extProfile - the ExtensionProfile to initialize.

getCommission

public Commission getCommission()
Returns the commission for the transaction.

Returns:
commission for the transaction

setCommission

public void setCommission(Commission commission)
Sets the commission for the transaction.

Parameters:
commission - commission for the transaction or null to reset

hasCommission

public boolean hasCommission()
Returns whether it has the commission for the transaction.

Returns:
whether it has the commission for the transaction

getDate

public DateTime getDate()
Returns the date at which the transaction occurred.

Returns:
date at which the transaction occurred

setDate

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

hasDate

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

getNotes

public java.lang.String getNotes()
Returns the notes.

Returns:
notes

setNotes

public void setNotes(java.lang.String notes)
Sets the notes.

Parameters:
notes - notes or null to reset

hasNotes

public boolean hasNotes()
Returns whether it has the notes.

Returns:
whether it has the notes

getPrice

public Price getPrice()
Returns the price of the transaction.

Returns:
price of the transaction

setPrice

public void setPrice(Price price)
Sets the price of the transaction.

Parameters:
price - price of the transaction or null to reset

hasPrice

public boolean hasPrice()
Returns whether it has the price of the transaction.

Returns:
whether it has the price of the transaction

getShares

public java.lang.Double getShares()
Returns the number of shares involved in the transaction.

Returns:
number of shares involved in the transaction

setShares

public void setShares(java.lang.Double shares)
Sets the number of shares involved in the transaction.

Parameters:
shares - number of shares involved in the transaction or null to reset

hasShares

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

getType

public java.lang.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")

setType

public void setType(java.lang.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

hasType

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")

validate

protected void validate()
Description copied from class: AbstractExtension
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.

Overrides:
validate in class AbstractExtension

getDefaultDescription

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

putAttributes

protected void putAttributes(AttributeGenerator generator)
Description copied from class: AbstractExtension
Puts attributes into the attribute generator. Called from AbstractExtension.generate(XmlWriter,ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Overrides:
putAttributes in class AbstractExtension
Parameters:
generator - attribute generator

consumeAttributes

protected void consumeAttributes(AttributeHelper helper)
                          throws ParseException
Description copied from class: AbstractExtension
Consumes attributes from the attribute helper. May also use AttributeHelper.consumeContent(boolean) to consume the element's text content. Called from AbstractExtension.getHandler(com.google.gdata.data.ExtensionProfile, java.lang.String, java.lang.String, org.xml.sax.Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Overrides:
consumeAttributes in class AbstractExtension
Parameters:
helper - attribute helper
Throws:
ParseException - any parsing exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object