atg.commerce.invoice
Class PropertyTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.invoice.PropertyTools
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
PropertyTools

public class PropertyTools
extends GenericService

Utility methods for copying properties between objects and repository items in a generic way.


Field Summary
static java.lang.String CLASS_VERSION
           
protected static java.util.ResourceBundle sDefaultResources
           
 
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
PropertyTools()
           
 
Method Summary
 void copyProperties(java.lang.Object pSource, java.lang.Object pDest, java.util.Properties pPropertyMap)
          Copy property values from one object to another, using a specified property mapping.
 MutableRepositoryItem getMutable(RepositoryItem pItem)
          Return a mutable version of the specified repository item.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

sDefaultResources

protected static java.util.ResourceBundle sDefaultResources
Constructor Detail

PropertyTools

public PropertyTools()
Method Detail

getMutable

public MutableRepositoryItem getMutable(RepositoryItem pItem)
                                 throws InvoiceException
Return a mutable version of the specified repository item. This method assumes that the item's parent repository is mutable.

Parameters:
pItem - A repository item, which may or may not be mutable.
Returns:
A mutable version of pItem. If pItem is already a mutable repository item, it is returned immediately. Otherwise a mutable version of the item is retrieved from the repository. In this case the return value is repository-dependent, and may or may not be the same object as pItem
Throws:
InvoiceException - If any error occurs getting the mutable item. In cases where pItem's parent repository is not a mutable repository the exception will wrap an underlying ClassCastException; in all other cases it will wrap an underlying RepositoryException.

copyProperties

public void copyProperties(java.lang.Object pSource,
                           java.lang.Object pDest,
                           java.util.Properties pPropertyMap)
                    throws InvoiceException
Copy property values from one object to another, using a specified property mapping. This method works on any two objects for which DynamicBeans can be used to set or get property values, which implies that either or both of the objects can be repository items if desired.

Parameters:
pSource - The source object from which property values being copied.
pDest - The destination object to which property values are being copied.
pPropertyMap - A mapping of source property name to destination property name. Each name in the map corresponds to a property of the source object whose value should be copied, the corresponding value in the map is the name of the destination property on the destination object.

Either or both of the property names may include dotted subproperty notation, allowing entries of the form telephoneNumber=deliveryInfo.phoneNumber in the property map.

Throws:
InvoiceException - if any error occurs getting property values from the source object or setting them on the destination object