com.google.checkout.checkout
Class Item

java.lang.Object
  extended by com.google.checkout.checkout.Item

public class Item
extends java.lang.Object

This class encapsulates the <item> element.

Author:
simonjsmith

Constructor Summary
Item()
          The default constructor.
Item(org.w3c.dom.Document document, org.w3c.dom.Element element)
          A constructor which takes the document and element pointing to the <item> tag.
 
Method Summary
 DigitalContent getDigitalContent()
          Retrieve the contents of the <digital-content> tag as a DigitalContent object.
 java.lang.String getItemDescription()
          Retrieve the contents of the <item-description> tag.
 java.lang.String getItemName()
          Retrieve the contents of the <item-name> tag.
 float getItemWeight()
          Retrieve the contents of the <item-weight> tag.
 java.lang.String getItemWeightUnit()
          Retrieve the contents of the unit attribute of the <item-weight> tag.
 java.lang.String getMerchantItemId()
          Retrieve the contents of the <merchant-item-id> tag.
 org.w3c.dom.Element[] getMerchantPrivateItemData()
          Retrieve the contents of the <merchant-private-item-data> tag as an array of Elements.
 int getQuantity()
          Retrieve the contents of the <quantity> tag.
 org.w3c.dom.Element getRootElement()
          Get the root element, <item>
 java.lang.String getTaxTableSelector()
          Retrieve the contents of the <tax-table-selector> tag.
 float getUnitPriceAmount()
          Retrieve the contents of the <unit-price> tag.
 java.lang.String getUnitPriceCurrency()
          Retrieve the contents of the currency attribute of the <unit-price> tag.
 void setDigitalContent(DigitalContent digitalContent)
          Set the contents of the <digital-content> tag as a DigitalContent object.
 void setItemDescription(java.lang.String description)
          Set the contents of the <item-description> tag.
 void setItemName(java.lang.String itemName)
          Set the contents of the <item-name> tag.
 void setItemWeight(float itemWeight)
          Set the contents of the currency attribute of the <item-weight> tag.
 void setItemWeightUnit(java.lang.String itemWeightUnit)
          Set the contents of the unit attribute of the <item-weight> tag.
 void setMerchantItemId(java.lang.String merchantItemId)
          Set the contents of the <merchant-item-id> tag.
 void setMerchantPrivateItemData(org.w3c.dom.Element[] elements)
          Set the contents of the <merchant-private-item-data> tag as an array of Elements.
 void setQuantity(int quantity)
          Set the contents of the <quantity> tag.
 void setTaxTableSelector(java.lang.String taxTableSelector)
          Set the contents of the <tax-table-selector> tag.
 void setUnitPriceAmount(float unitPriceAmount)
          Set the contents of the <unit-price> tag.
 void setUnitPriceCurrency(java.lang.String unitPriceCurrencyCode)
          Set the contents of the currency attribute of the <unit-price> tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Item

public Item(org.w3c.dom.Document document,
            org.w3c.dom.Element element)
A constructor which takes the document and element pointing to the <item> tag.

Parameters:
document - The document.
element - The element.

Item

public Item()
The default constructor.

Method Detail

getItemDescription

public java.lang.String getItemDescription()
Retrieve the contents of the <item-description> tag.

Returns:
The item description.

getItemName

public java.lang.String getItemName()
Retrieve the contents of the <item-name> tag.

Returns:
The item name.

getMerchantItemId

public java.lang.String getMerchantItemId()
Retrieve the contents of the <merchant-item-id> tag.

Returns:
The merchant item id.

getMerchantPrivateItemData

public org.w3c.dom.Element[] getMerchantPrivateItemData()
Retrieve the contents of the <merchant-private-item-data> tag as an array of Elements.

Returns:
The private data Elements.
See Also:
Element

getQuantity

public int getQuantity()
Retrieve the contents of the <quantity> tag.

Returns:
The quantity as an int.

getTaxTableSelector

public java.lang.String getTaxTableSelector()
Retrieve the contents of the <tax-table-selector> tag.

Returns:
The tax table selector name.

getUnitPriceAmount

public float getUnitPriceAmount()
Retrieve the contents of the <unit-price> tag.

Returns:
The unit price as a float.

getUnitPriceCurrency

public java.lang.String getUnitPriceCurrency()
Retrieve the contents of the currency attribute of the <unit-price> tag.

Returns:
The currency code.

getItemWeight

public float getItemWeight()
Retrieve the contents of the <item-weight> tag.

Returns:
The item weight.

getItemWeightUnit

public java.lang.String getItemWeightUnit()
Retrieve the contents of the unit attribute of the <item-weight> tag.

Returns:
The item weight unit.

setItemDescription

public void setItemDescription(java.lang.String description)
Set the contents of the <item-description> tag.

Parameters:
description - The item description.

setItemName

public void setItemName(java.lang.String itemName)
Set the contents of the <item-name> tag.

Parameters:
itemName - The item name.

setMerchantItemId

public void setMerchantItemId(java.lang.String merchantItemId)
Set the contents of the <merchant-item-id> tag.

Parameters:
merchantItemId - The merchant item id.

setMerchantPrivateItemData

public void setMerchantPrivateItemData(org.w3c.dom.Element[] elements)
Set the contents of the <merchant-private-item-data> tag as an array of Elements. If the merchant-private-item-data tag already exists, it will be replaced with the contents of elements.

Parameters:
elements - The private data elements.
See Also:
Element

setQuantity

public void setQuantity(int quantity)
Set the contents of the <quantity> tag.

Parameters:
quantity - The quantity as an int.

setTaxTableSelector

public void setTaxTableSelector(java.lang.String taxTableSelector)
Set the contents of the <tax-table-selector> tag.

Parameters:
taxTableSelector - The tax table selector name.

setUnitPriceAmount

public void setUnitPriceAmount(float unitPriceAmount)
Set the contents of the <unit-price> tag.

Parameters:
unitPriceAmount - The unit price as a float.

setUnitPriceCurrency

public void setUnitPriceCurrency(java.lang.String unitPriceCurrencyCode)
Set the contents of the currency attribute of the <unit-price> tag.

Parameters:
unitPriceCurrencyCode - The currency code.

setItemWeight

public void setItemWeight(float itemWeight)
Set the contents of the currency attribute of the <item-weight> tag.

Parameters:
itemWeight - The item weight.

setItemWeightUnit

public void setItemWeightUnit(java.lang.String itemWeightUnit)
Set the contents of the unit attribute of the <item-weight> tag.

Parameters:
itemWeightUnit - The item weight unit.

getDigitalContent

public DigitalContent getDigitalContent()
Retrieve the contents of the <digital-content> tag as a DigitalContent object.

Returns:
The DigitalContent object.
See Also:
DigitalContent

setDigitalContent

public void setDigitalContent(DigitalContent digitalContent)
Set the contents of the <digital-content> tag as a DigitalContent object.

Parameters:
digitalContent - The DigitalContent object.
See Also:
DigitalContent

getRootElement

public org.w3c.dom.Element getRootElement()
Get the root element, <item>

Returns:
The root element, <item>.