📄 runtypebo.java
字号:
/* @LICENSE_COPYRIGHT@ */package net.sf.irunninglog.businessobject;import java.util.List;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import net.sf.irunninglog.canonical.RunType;import net.sf.irunninglog.util.ConversionException;import net.sf.irunninglog.util.DTO;/** * Business object representing a <em>Run Type</em>. This is a POJO business * object (BO) implementation that is used to represent <em>Run Type</em> * entities within the application's business layer. * * @author <a href="mailto:allan_e_lewis@yahoo.com">Allan Lewis</a> * @version $Revision: 1.2 $ $Date: 2005/06/25 15:18:19 $ * @since iRunningLog 1.0 */public class RunTypeBO extends ReferenceDataBO { /** <code>Log</code> instance for this class. */ private static final Log LOG = LogFactory.getLog(RunTypeBO.class); /** * Create a new business object instance. * * @deprecated Use the <code>BusinessObjectFactory</code> to obtain new * instances * @see BusinessObjectFactory#newInstance(String) */ public RunTypeBO() { super(); } /** * Get a data transfer objects containing values that represent the current * state of this BO. This is a template method that is called from the * final method <code>getValues</code> in <code>BaseBO</code>. * * @return The data transfer object, populated with the appropriate values * @see BaseBO#getValues() */ protected DTO getValuesInternal() { DTO valueObject = super.getValuesInternal(); if (LOG.isDebugEnabled()) { LOG.debug("getValuesInternal: Contents of the value object " + " (before) " + valueObject); } valueObject.setCanonicalId(RunType.CANONICAL_ID); if (LOG.isDebugEnabled()) { LOG.debug("getValuesInternal: Contents of the value object (after) " + valueObject); } return valueObject; } /** * Update the BO's fields with the values provided in a data transfer * object. This is a template method that is called from the final * <code>setValue</code> method in <code>BaseBO</code>. * * @param valueObject The data transfer object containing values to be * used in updating this BO * @throws ConversionException If a conversion error occurrs while setting * the fields * @see BaseBO#setValues(DTO) */ protected void setValuesInternal(DTO valueObject) throws ConversionException { if (LOG.isDebugEnabled()) { LOG.debug("setValuesInternal: No values to set at this level"); } super.setValuesInternal(valueObject); } /** * Validate the values contained in a data transfer object. This method * is reponsible for perofrming all validations on the transfer object, and * should be called before updating the BO's fields to avoid * bad data and/or errors. * * @param valueObject The data transfer object whose fields are to be * validated * @return A list consisting of any errors found while validating the * transfer object */ protected List validateValues(DTO valueObject) { List errors = super.validateValues(valueObject); if (LOG.isDebugEnabled()) { LOG.debug("validateValues: No values to validate at this level"); } return errors; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -