|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.order.processor.ShippingAddrValidatorImpl
public class ShippingAddrValidatorImpl
This class provides a default implementation of ShippingAddrValidator. By default the following address properties are checked :
If the address is an instance of atg.core.util.ContactInfo, the following properties may also be checked:
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ShippingAddrValidatorImpl()
|
Method Summary | |
---|---|
protected void |
addHashedError(PipelineResult pResult,
java.lang.String pKey,
java.lang.String pId,
java.lang.Object pError)
This method adds an error to the PipelineResult object. |
boolean |
countryNeedsState(java.lang.String pCountry)
Determine whether a state is required based on the country by consulting the property countriesWithStates . |
java.lang.String[] |
getCountriesWithStates()
Return the list of countries for which a state or province is required to have a valid shipping address. |
boolean |
getValidateAddress1()
Returns property validateAddress1 |
boolean |
getValidateCity()
Returns property validateCity |
boolean |
getValidateCountry()
Returns the validateCountry flag |
boolean |
getValidateCounty()
Returns property validateCounty |
boolean |
getValidateEmail()
Returns the validateEmail flag |
boolean |
getValidateFaxNumber()
Returns the validateFaxNumber flag |
boolean |
getValidateFirstName()
Returns property validateFirstName |
boolean |
getValidateLastName()
Returns property validateLastName |
boolean |
getValidatePhoneNumber()
Returns the validatePhoneNumber flag |
boolean |
getValidatePostalCode()
Returns property validatePostalCode |
boolean |
getValidateState()
Returns property validateState |
boolean |
isEmpty(java.lang.String pStr)
Return true if pStr is null or consists entirely of whitespace. |
void |
setCountriesWithStates(java.lang.String[] pCountriesWithStates)
Specify the set of countries for which a state or province name is required in order to have a valid shipping address. |
void |
setValidateAddress1(boolean pValidateAddress1)
Sets property validateAddress1 |
void |
setValidateCity(boolean pValidateCity)
Sets property validateCity |
void |
setValidateCountry(boolean pValidateCountry)
Sets the validateCountry flag. |
void |
setValidateCounty(boolean pValidateCounty)
Sets property validateCounty |
void |
setValidateEmail(boolean pValidateEmail)
Sets the validateEmail flag. |
void |
setValidateFaxNumber(boolean pValidateFaxNumber)
Sets the validateFaxNumber flag. |
void |
setValidateFirstName(boolean pValidateFirstName)
Sets property validateFirstName |
void |
setValidateLastName(boolean pValidateLastName)
Sets property validateLastName |
void |
setValidatePhoneNumber(boolean pValidatePhoneNumber)
Sets the validatePhoneNumber flag. |
void |
setValidatePostalCode(boolean pValidatePostalCode)
Sets property validatePostalCode |
void |
setValidateState(boolean pValidateState)
Sets property validateState |
protected boolean |
validateEmailAddress(java.lang.String pEmail)
Validates an email address for correctness. |
protected boolean |
validatePhoneNumber(java.lang.String pPhoneNumber)
Validates a phone number for correctness. |
void |
validateShippingAddress(Address pAddr,
java.lang.String pId,
PipelineResult pResult,
java.util.Locale pLocale)
Verify that all required properties are present in a shipping address. |
void |
validateShippingAddress(Address pAddr,
java.lang.String pId,
PipelineResult pResult,
java.util.ResourceBundle pResources)
Verify that all required properties are present in a shipping address. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ShippingAddrValidatorImpl()
Method Detail |
---|
public void validateShippingAddress(Address pAddr, java.lang.String pId, PipelineResult pResult, java.util.Locale pLocale)
validateShippingAddress
in interface ShippingAddrValidator
pAddr
- The shipping address being examined.pId
- The id of the object that owns the shipping address, used in
constructing error messages. For example, when validating the
address in a shipping group, the caller might provide the shipping
group id here.pResult
- A PipelineResult object in which to store error messages if any
required values are missing from the address.pLocale
- The optional locale to use when looking up the resource bundle
that contains error messages. If null, the default server locale
will be used.public void validateShippingAddress(Address pAddr, java.lang.String pId, PipelineResult pResult, java.util.ResourceBundle pResources)
validateShippingAddress
in interface ShippingAddrValidator
pAddr
- The shipping address being examined.pId
- The id of the object that owns the shipping address, used in
constructing error messages. For example, when validating the
address in a shipping group, the caller might provide the shipping
group id here.pResult
- A PipelineResult object in which to store error messages if any
required values are missing from the address.pResources
- The resource bundle from which to retrieve error messages.public void setCountriesWithStates(java.lang.String[] pCountriesWithStates)
This property is a list of countries that the site can ship to for which a state (province) field is required in order to have a valid shipping address. For example, "usa" and "canada" might go on this list, but "germany" would not.
The country names in this list should be lower case and must be spelled as they would be spelled when the user enters or selects them. If the user chooses a country from a menu it is easy to make this list consistent with user input. If the user provides the name through a text input field, this list should contain common variations and misspellings, since the value in the list must match the user's input exactly except. Comparisons are case-insensitive, so it is not necessary to include all possible combinations of capitalization in this list.
public java.lang.String[] getCountriesWithStates()
public boolean countryNeedsState(java.lang.String pCountry)
countriesWithStates
.
pCountry
- The country name being queried. If null, assume the country does
require a state or province designation as part of the shipping
address.
protected boolean validatePhoneNumber(java.lang.String pPhoneNumber)
protected boolean validateEmailAddress(java.lang.String pEmail)
public boolean isEmpty(java.lang.String pStr)
protected void addHashedError(PipelineResult pResult, java.lang.String pKey, java.lang.String pId, java.lang.Object pError)
pResult
- the PipelineResult object supplied in runProcess()pKey
- the key to use to store the HashMap in the PipelineResult objectpId
- the key to use to store the error message within the HashMap in the
PipelineResult objectpError
- the error object to store in the HashMapPipelineResult
,
#runProcess(Object, PipelineResult)
public boolean getValidateFirstName()
public void setValidateFirstName(boolean pValidateFirstName)
pValidateFirstName
- the value to set for property validateFirstNamepublic boolean getValidateLastName()
public void setValidateLastName(boolean pValidateLastName)
pValidateLastName
- the value to set for property validateLastNamepublic boolean getValidateAddress1()
public void setValidateAddress1(boolean pValidateAddress1)
pValidateAddress1
- the value to set for property validateAddress1public boolean getValidateCity()
public void setValidateCity(boolean pValidateCity)
pValidateCity
- the value to set for property validateCitypublic boolean getValidateCounty()
public void setValidateCounty(boolean pValidateCounty)
pValidateCounty
- the value to set for property validateCountypublic boolean getValidateState()
public void setValidateState(boolean pValidateState)
pValidateState
- the value to set for property validateStatepublic boolean getValidatePostalCode()
public void setValidatePostalCode(boolean pValidatePostalCode)
pValidatePostalCode
- the value to set for property validatePostalCodepublic boolean getValidateCountry()
public void setValidateCountry(boolean pValidateCountry)
public boolean getValidatePhoneNumber()
public void setValidatePhoneNumber(boolean pValidatePhoneNumber)
public boolean getValidateFaxNumber()
public void setValidateFaxNumber(boolean pValidateFaxNumber)
public boolean getValidateEmail()
public void setValidateEmail(boolean pValidateEmail)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |