public class TransactionData extends ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
AbstractExtension.AttributesHandler
xmlBlob
localName, namespace
Constructor and Description |
---|
TransactionData()
Default mutable constructor.
|
TransactionData(DateTime date,
java.lang.String notes,
java.lang.Double shares,
java.lang.String type)
Immutable constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable
public TransactionData()
public TransactionData(DateTime date, java.lang.String notes, java.lang.Double shares, java.lang.String type)
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 void declareExtensions(ExtensionProfile extProfile)
ExtensionPoint
declareExtensions
in class ExtensionPoint
extProfile
- the ExtensionProfile to initialize.public Commission getCommission()
public void setCommission(Commission commission)
commission
- commission for the transaction or null
to
resetpublic boolean hasCommission()
public DateTime getDate()
public void setDate(DateTime date)
date
- date at which the transaction occurred or null
to
resetpublic boolean hasDate()
public java.lang.String getNotes()
public void setNotes(java.lang.String notes)
notes
- notes or null
to resetpublic boolean hasNotes()
public Price getPrice()
public void setPrice(Price price)
price
- price of the transaction or null
to resetpublic boolean hasPrice()
public java.lang.Double getShares()
public void setShares(java.lang.Double shares)
shares
- number of shares involved in the transaction or
null
to resetpublic boolean hasShares()
public java.lang.String getType()
public void setType(java.lang.String type)
type
- type for the transaction (can be "Buy", "Sell", "Buy to Cover"
or "Sell Short") or null
to resetpublic boolean hasType()
protected void validate()
AbstractExtension
validate
in class AbstractExtension
public static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
required
- whether it is requiredrepeatable
- whether it is repeatableprotected void putAttributes(AttributeGenerator generator)
AbstractExtension
AbstractExtension.generate(XmlWriter,ExtensionProfile)
. Default implementation
does nothing, though generally this is discouraged unless there really are
no attributes.putAttributes
in class AbstractExtension
generator
- attribute generatorprotected void consumeAttributes(AttributeHelper helper) throws ParseException
AbstractExtension
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.consumeAttributes
in class AbstractExtension
helper
- attribute helperParseException
- any parsing exceptionpublic java.lang.String toString()
toString
in class java.lang.Object