com.elasticpath.domain.tax
Interface TaxJurisdiction

All Superinterfaces:
Entity, EpDomain, Persistence, java.io.Serializable
All Known Implementing Classes:
TaxJurisdictionImpl

public interface TaxJurisdiction
extends Entity

A TaxJurisdiction represents a geographic area that has it's own distinct set of TaxCategorys and TaxValues ie a Country, a State, a City, a Municipal, or a County.


Field Summary
static int FIELD_MATCH_CITY
          field match type: city.
static int FIELD_MATCH_COUNTRY
          field match type: country.
static int FIELD_MATCH_NONE
          field match type: none.
static int FIELD_MATCH_SUBCOUNTRY
          field match type: subcountry.
static int FIELD_MATCH_ZIP_POSTAL_CODE
          field match type: zip/postal code.
static java.lang.Boolean PRICE_CALCULATION_EXCLUSIVE
          the "exclusive" price calculation method - item price does NOT include tax.
static java.lang.Boolean PRICE_CALCULATION_INCLUSIVE
          the "inclusive" price calculation method - item price DOES include tax.
 
Method Summary
 int getFieldMatchType()
          Retrieve the field match type for this TaxJurisdiction.
 java.util.Map getFullTaxValueMap()
          Traverse the parent TaxJurisdiction and build up a map of taxValues, keyed by TaxCategory.
 TaxJurisdiction getParent()
          Get the parent taxJurisdiction of this taxJurisdiction.
 java.lang.Boolean getPriceCalculationMethod()
          Return the price calculation method of this TaxCategory.
 java.lang.String getRegionCode()
          Get the region code of the geographic area represented by the TaxJurisdiction.
 java.lang.String getRegionCodePathStr()
          Retrieve the region path of this taxJurisdiction, i.e.
 java.lang.String getRegionCodePathStrWithoutCity()
          Retrieve the region path of this taxJurisdiction, i.e.
 java.util.Map getTaxCategoryXMap()
          Get the taxCategoryUid -> TaxJurisdictionCategoryX map.
 boolean isParent(TaxJurisdiction taxJurisdiction)
          Check if this taxJurisdiction is the direct or indirect parent of the given taxJurisdiction.
 void setFieldMatchType(int fieldMatchType)
          Set the field match type for this TaxJurisdiction.
 void setParent(TaxJurisdiction parent)
          Set the parent taxJurisdiction of this taxJurisdiction.
 void setPriceCalculationMethod(java.lang.Boolean priceCalculationMethod)
          Set the price calculation method of this TaxCategory.
 void setRegionCode(java.lang.String regionCode)
          Set the region code of the geographic area represented by the TaxJurisdiction.
 void setTaxCategoryXMap(java.util.Map taxCategoryXMap)
          Set the taxCategoryUid -> TaxJurisdictionCategoryX map.
 
Methods inherited from interface com.elasticpath.domain.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

FIELD_MATCH_CITY

static final int FIELD_MATCH_CITY
field match type: city.

See Also:
Constant Field Values

FIELD_MATCH_COUNTRY

static final int FIELD_MATCH_COUNTRY
field match type: country.

See Also:
Constant Field Values

FIELD_MATCH_NONE

static final int FIELD_MATCH_NONE
field match type: none.

See Also:
Constant Field Values

FIELD_MATCH_SUBCOUNTRY

static final int FIELD_MATCH_SUBCOUNTRY
field match type: subcountry.

See Also:
Constant Field Values

FIELD_MATCH_ZIP_POSTAL_CODE

static final int FIELD_MATCH_ZIP_POSTAL_CODE
field match type: zip/postal code.

See Also:
Constant Field Values

PRICE_CALCULATION_EXCLUSIVE

static final java.lang.Boolean PRICE_CALCULATION_EXCLUSIVE
the "exclusive" price calculation method - item price does NOT include tax.


PRICE_CALCULATION_INCLUSIVE

static final java.lang.Boolean PRICE_CALCULATION_INCLUSIVE
the "inclusive" price calculation method - item price DOES include tax.

Method Detail

getFieldMatchType

int getFieldMatchType()
Retrieve the field match type for this TaxJurisdiction.

Returns:
the field match type for this TaxJurisdiction.

getFullTaxValueMap

java.util.Map getFullTaxValueMap()
Traverse the parent TaxJurisdiction and build up a map of taxValues, keyed by TaxCategory. The TaxValue specified at a lower taxJurisdiction level will be used. Since the tax value configuration should not be changed so often, so it is cached.

Returns:
the fully populated taxValue map.

getParent

TaxJurisdiction getParent()
Get the parent taxJurisdiction of this taxJurisdiction. Returns null if this taxJurisdiction doesn't have a parent.

Returns:
the parent taxJurisdiction (or null no parent).

getPriceCalculationMethod

java.lang.Boolean getPriceCalculationMethod()
Return the price calculation method of this TaxCategory.

Returns:
the price calculation method.

getRegionCode

java.lang.String getRegionCode()
Get the region code of the geographic area represented by the TaxJurisdiction.

Returns:
the regionCode

getRegionCodePathStr

java.lang.String getRegionCodePathStr()
Retrieve the region path of this taxJurisdiction, i.e. "BC CA", where BC is the region code of this taxJurisdiction and CA is the region code of its parent taxJurisdiction.

Returns:
the region path of this taxJurisdiction

getRegionCodePathStrWithoutCity

java.lang.String getRegionCodePathStrWithoutCity()
Retrieve the region path of this taxJurisdiction, i.e. "BC CA", where BC is the region code of this taxJurisdiction and CA is the region code of its parent taxJurisdiction. However the region code is skipped if the parent TaxJurisdiction's field match type is 3 (FIELD_MATCH_CITY).

Returns:
the region path of this taxJurisdiction

getTaxCategoryXMap

java.util.Map getTaxCategoryXMap()
Get the taxCategoryUid -> TaxJurisdictionCategoryX map.

Returns:
the taxCategoryUid -> TaxJurisdictionCategoryX map.

isParent

boolean isParent(TaxJurisdiction taxJurisdiction)
Check if this taxJurisdiction is the direct or indirect parent of the given taxJurisdiction.

Parameters:
taxJurisdiction - the taxJurisdiction to be checked to see if it is the direct/indirect child.
Returns:
whether this taxJurisdiction is the direct or indirect parent of the given taxJurisdiction.

setFieldMatchType

void setFieldMatchType(int fieldMatchType)
Set the field match type for this TaxJurisdiction.

Parameters:
fieldMatchType - the field match type.

setParent

void setParent(TaxJurisdiction parent)
Set the parent taxJurisdiction of this taxJurisdiction.

Parameters:
parent - - the parent taxJurisdiction.

setPriceCalculationMethod

void setPriceCalculationMethod(java.lang.Boolean priceCalculationMethod)
Set the price calculation method of this TaxCategory.

Parameters:
priceCalculationMethod - - the price calculation method to be set.

setRegionCode

void setRegionCode(java.lang.String regionCode)
Set the region code of the geographic area represented by the TaxJurisdiction.

Parameters:
regionCode - the parameter regionCode

setTaxCategoryXMap

void setTaxCategoryXMap(java.util.Map taxCategoryXMap)
Set the taxCategoryUid -> TaxJurisdictionCategoryX map.

Parameters:
taxCategoryXMap - - the taxCategoryUid -> TaxJurisdictionCategoryX map.