public final class CSCountryMultiple extends CSItemMultiple
The CSCountryMultiple
class provides a method that retrieves several countries from the database. This
method requires that certain database and key information (country name list, for example) be specified via the
set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSCountryMultiple
class.
CSCountry
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSCountryMultiple()
Creates an empty
CSCountryMultiple object. |
CSCountryMultiple(java.lang.String strPropertyFile)
Creates a new
CSCountryMultiple , specifying a properties file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSCountryMultiple . |
boolean |
exist()
Not currently implemented for
CSCountryMultiple . |
void |
get()
Retrieves the details of several countries from the database.
|
java.lang.String |
getCountryNameList()
Gets the list of country names specified as key information.
|
java.lang.String |
getCountryNumberList()
Gets the list of country numbers specified as key information.
|
java.lang.String |
getFilter()
Gets the filter text specified as key information.
|
int |
getShippingZoneID()
Gets the shipping zone ID specified as key information.
|
int |
getVatZoneID()
Gets the vat zone ID specified as key information.
|
void |
setCountryNameList(java.lang.String strCountryNameList)
Specifies the country names of the countries that are to be retrieved.
|
void |
setCountryNumberList(java.lang.String strCountryNumberList)
Specifies the country numbers of the countries that are to be retrieved.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setFilter(java.lang.String strFilter)
Specifies the filter text for which countries with names that match the filter text are to be retrieved.
|
void |
setShippingZoneID(int nShippingZoneID)
Specifies the ID of the shipping zone for which its countries are to be retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the countries are to be retrieved.
|
void |
setVatZoneID(int nVatZoneID)
Specifies the ID of the vat zone for which its countries are to be retrieved.
|
void |
update()
Not currently implemented for
CSCountryMultiple . |
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow, toString
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSCountryMultiple()
CSCountryMultiple
object.
Use the various set
methods provided to initialise the CSCountryMultiple
object
prior to invoking any of its query methods.
public CSCountryMultiple(java.lang.String strPropertyFile)
CSCountryMultiple
, specifying a properties file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSCountryMultiple
object prior to invoking
any of its query methods.
strPropertyFile
- the property file that contains the connection details.public java.lang.String getCountryNumberList()
public void setCountryNumberList(java.lang.String strCountryNumberList)
setCountryNumberList
followed by a call to get
returns details of all the specified
countries.
strCountryNumberList
- a comma-separated list of country numbers.public java.lang.String getCountryNameList()
public void setCountryNameList(java.lang.String strCountryNameList)
setCountryNameList
followed by a call to get
returns details of all the specified
countries.
strCountryNameList
- a comma-separated list of country names.public int getVatZoneID()
public void setVatZoneID(int nVatZoneID)
setVatZoneID
followed by a call to get
returns details of all the countries of the
specified vat zone.
nVatZoneID
- the vat zone ID.public int getShippingZoneID()
public void setShippingZoneID(int nShippingZoneID)
setShippingZoneID
followed by a call to get
returns details of all the countries of
the specified shipping zone.
nShippingZoneID
- the shipping zone ID.public java.lang.String getFilter()
public void setFilter(java.lang.String strFilter)
setFilter
followed by a call to get
returns details of all the countries that have
names which match with the specified filter text.
Use %
as a wild-card character. For example, A%
specifies 'beginning with A' and
%A%
means 'containing A'.
strFilter
- the filter text string.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for a country are :
LEVEL_ID
Retrieves the CountryNumber.LEVEL_SUMMARY
Retrieves the CountryName.LEVEL_DETAIL
Retrieves the AbbrevTwo, AbbrevThree, CurrencySymbol, CurrencyName,
CurrencyCodeAlpha, CurrencyCodeNumeric, CurrencyMinorDecimalPlaces, ExchangeRate.LEVEL_ALL
Retrieves all country data.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setCountryNumberList
or
setCountryNameList
key information is being supplied. One or more of the
available sort orders may be specified as a comma-delimited list. Use ASC or DESC to indicate the direction of
ordering for a sort order. For example, "CountryName DESC" would order in descending order of name. The default
sort order in this instance is 'CountryName ASC'.
Available sort orders are :
CountryName - order by the official country name
CountryNumber - order by the country number
setSortOrder
in class CSItemMultiple
strSortOrderList
- a comma-separated list of one or more of the available sort orders.CSParameterException
- if an invalid sort order was specifiedpublic boolean exist() throws CSException
CSCountryMultiple
.
exist
in class CSItemMultiple
true
if all countries exist on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
Use setCountryNumberList
followed by get
to populate this
CSCountryMultiple
object with the details of the countries specified in the list. The retrieved
countries will appear within CSCountryMultiple
in the order that their country numbers appear
within the supplied list. Key information set using setSortOrder
,
setMaxRows
and setStartRow
is not valid in this instance.
Use setCountryNameList
followed by get
to populate this
CSCountryMultiple
object with the details of the countries specified in the list. The retrieved
countries will appear within CSCountryMultiple
in the order that their official country names
appear within the supplied list. Key information set using setSortOrder
,
setMaxRows
and setStartRow
is not valid in this instance.
Use setVatZoneID
followed by get
to populate this
CSCountryMultiple
object with the details of the countries for the specified vat zone.
Use setShippingZoneID
followed by get
to populate this
CSCountryMultiple
object with the details of the countries for the specified shipping zone.
Use setFilter
followed by get
to populate this
CSCountryMultiple
object with the details of the countries whose official country names match with
the specified filter text.
Each retrieved country is stored as a CSCountry
object within the item ArrayList
member of
CSCountryMultiple
- use getItems
or iterator
to
access/navigate through them. These countries will be stored in the ArrayList
in the order
specified using the setSortOrder
method, or the default sort order of 'CountryName
ASC'. However, if a list of country numbers or names were specified, the countries are stored in the same order
as in the specified list.
get
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified countries cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
CSCountryMultiple
.
update
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified countries cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSCountryMultiple
.
delete
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified countries cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.