atg.commerce.order.processor
Class ShippingAddrValidatorImpl

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.util.AddressValidatorImpl
              extended by atg.commerce.order.processor.ShippingAddrValidatorImpl
All Implemented Interfaces:
ShippingAddrValidator, AddressValidator, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ShippingAddrValidatorImpl
extends AddressValidatorImpl
implements ShippingAddrValidator

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.commerce.util.AddressValidatorImpl
ADDRESS1_MISSING, CITY_MISSING, COUNTRY_MISSING, COUNTY_MISSING, EMAIL_INVALID, EMAIL_MISSING, ERROR_MAP_KEY, FAX_NUMBER_INVALID, FAX_NUMBER_MISSING, FIRST_NAME_MISSING, LAST_NAME_MISSING, mCountriesWithStates, mValidateAddress1, mValidateCity, mValidateCountry, mValidateCounty, mValidateEmail, mValidateFaxNumber, mValidateFirstName, mValidateLastName, mValidatePhoneNumber, mValidatePostalCode, mValidateState, PHONE_NUMBER_INVALID, PHONE_NUMBER_MISSING, POSTAL_CODE_MISSING, RESOURCE_MAP_KEY, STATE_MISSING
 
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  java.util.Map compileResourceAndErrorMaps()
          This method compiles and returns a alternate resource and error key maps.
 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.commerce.util.AddressValidatorImpl
addError, addHashedError, countryNeedsState, getCountriesWithStates, getValidateAddress1, getValidateCity, getValidateCountry, getValidateCounty, getValidateEmail, getValidateFaxNumber, getValidateFirstName, getValidateLastName, getValidatePhoneNumber, getValidatePostalCode, getValidateState, isEmpty, setCountriesWithStates, setValidateAddress1, setValidateCity, setValidateCountry, setValidateCounty, setValidateEmail, setValidateFaxNumber, setValidateFirstName, setValidateLastName, setValidatePhoneNumber, setValidatePostalCode, setValidateState, validateAddress, validateAddress, validateAddress, validateAddress, validateAddress, validateEmailAddress, validatePhoneNumber
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ShippingAddrValidatorImpl

public ShippingAddrValidatorImpl()
Method Detail

validateShippingAddress

public 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.

Specified by:
validateShippingAddress in interface ShippingAddrValidator
Parameters:
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.
See Also:
validateShippingAddress(Address, String, PipelineResult, ResourceBundle)

validateShippingAddress

public 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.

Specified by:
validateShippingAddress in interface ShippingAddrValidator
Parameters:
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.
See Also:
AddressValidatorImpl.validateAddress(Address, String, PipelineResult, ResourceBundle, Map), compileResourceAndErrorMaps()

compileResourceAndErrorMaps

protected java.util.Map compileResourceAndErrorMaps()
This method compiles and returns a alternate resource and error key maps. The base class defines a bunch of error message keys and uses the same key to look up error message in the resource bundle and to save the error message in a map. This class uses different set of resource and error keys to look up error message in the resource bundle and to save the error message in a map.

For example, the base class defines FirstNameMissing as the resource key and error key and uses same key to look up error message for missing first name and save the resourced error message in a map. This class requires a different resource and error key for the same field error message such as ShipFirstNameMissing and MissingShippingFirstName to look up and save the error message.

Similarly this method looks keys for all the fields and and creates two maps. one of the map for resource key map and another for error key map. You can lookup the resource map with resourceMapKey and error map with errorMapKey keys.

Returns:
Returns the compiled list of alternate resource and error key maps.
See Also:
-- The resource key map can be accessed using this key. This key contains a map of base class key and alternate resource key., The error key map can be accessed using this key. This key contains a map of base class key key and alternate error key.