com.google.checkout.checkout
Class ShippingRestrictions

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

public class ShippingRestrictions
extends java.lang.Object

This class represents the <shipping-restrictions> tag in the Checkout API.

Author:
simonjsmith@google.com

Constructor Summary
ShippingRestrictions()
          The default constructor.
 
Method Summary
 void addAllowedCountryArea(USArea countryArea)
          This method adds an allowed U.S.
 void addAllowedPostalArea(java.lang.String countryCode, java.lang.String postalCodePattern)
          This method adds an allowed <postal-area> element.
 void addAllowedStateCode(java.lang.String stateCode)
          This method adds an allowed U.S.
 void addAllowedWorldArea()
          This method adds an allowed <world-area> element.
 void addAllowedZipPattern(java.lang.String zipPattern)
          This method adds an allowed zip code pattern to a <us-zip-area> element.
 void addExcludedCountryArea(USArea countryArea)
          This method adds an excluded U.S.
 void addExcludedPostalArea(java.lang.String countryCode, java.lang.String postalCodePattern)
          This method adds an excluded <postal-area> element.
 void addExcludedStateCode(java.lang.String stateCode)
          This method adds an excluded U.S.
 void addExcludedWorldArea()
          This method adds an excluded <world-area> element.
 void addExcludedZipPattern(java.lang.String zipPattern)
          This method adds an excluded zip code pattern to a <us-zip-area> element.
 org.w3c.dom.Element getRootElement()
          Get the root element, <shipping-restrictions>
 boolean isAllowUsPoBox()
          Retrieve the value of the <allow-us-po-box> tag.
 void setAllowUsPoBox(boolean b)
          Set the value of the <allow-us-po-box> tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShippingRestrictions

public ShippingRestrictions()
The default constructor.

Method Detail

addAllowedCountryArea

public void addAllowedCountryArea(USArea countryArea)
This method adds an allowed U.S. country area to a <us-country-area> element. The <us-country-area> element, in turn, appears as a subelement of <allowed-areas>.

Parameters:
countryArea - The country area.
See Also:
USArea

addAllowedStateCode

public void addAllowedStateCode(java.lang.String stateCode)
This method adds an allowed U.S. state code to a <us-state-area> element. The <us-state-area> element, in turn, appears as a subelement of <allowed-areas>.

Parameters:
stateCode - The state code.

addAllowedZipPattern

public void addAllowedZipPattern(java.lang.String zipPattern)
This method adds an allowed zip code pattern to a <us-zip-area> element. The <us-zip-area> element, in turn, appears as a subelement of <allowed-areas>.

Parameters:
zipPattern - The zip pattern.

addExcludedCountryArea

public void addExcludedCountryArea(USArea countryArea)
This method adds an excluded U.S. country area to a <us-country-area> element. The <us-country-area> element, in turn, appears as a subelement of <excluded-areas>.

Parameters:
countryArea - The country area.
See Also:
USArea

addExcludedStateCode

public void addExcludedStateCode(java.lang.String stateCode)
This method adds an excluded U.S. state code to a <us-state-area> element. The <us-state-area> element, in turn, appears as a subelement of <excluded-areas>.

Parameters:
stateCode - The state code.

addExcludedZipPattern

public void addExcludedZipPattern(java.lang.String zipPattern)
This method adds an excluded zip code pattern to a <us-zip-area> element. The <us-zip-area> element, in turn, appears as a subelement of <excluded-areas>.

Parameters:
zipPattern - The zip pattern.

getRootElement

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

Returns:
The root element, <shipping-restrictions>.

addAllowedPostalArea

public void addAllowedPostalArea(java.lang.String countryCode,
                                 java.lang.String postalCodePattern)
This method adds an allowed <postal-area> element. The <country-code> element and optionally the <postal-code-pattern> are subelements .

Parameters:
countryCode - The country code.
postalCodePattern - The Postal Code Pattern.

addAllowedWorldArea

public void addAllowedWorldArea()
This method adds an allowed <world-area> element.


addExcludedPostalArea

public void addExcludedPostalArea(java.lang.String countryCode,
                                  java.lang.String postalCodePattern)
This method adds an excluded <postal-area> element. The <country-code> element and optionally the <postal-code-pattern> are subelements .

Parameters:
countryCode - The country code.
postalCodePattern - The Postal Code Pattern.

addExcludedWorldArea

public void addExcludedWorldArea()
This method adds an excluded <world-area> element.


isAllowUsPoBox

public boolean isAllowUsPoBox()
Retrieve the value of the <allow-us-po-box> tag.

Returns:
Whether the shipping allows a US PO Box.

setAllowUsPoBox

public void setAllowUsPoBox(boolean b)
Set the value of the <allow-us-po-box> tag.

Parameters:
b - Whether the shipping allows a US PO Box.