recordlistbean.java

来自「库存管理系统:这是在Eclipse环境下开发的」· Java 代码 · 共 93 行

JAVA
93
字号
package cn.hxex.library.view.bean;

import java.util.List;

import cn.hxex.library.exception.LibraryException;
import cn.hxex.library.model.Product;
import cn.hxex.library.view.util.FacesUtils;
import cn.hxex.library.view.util.ViewUtils;

public class RecordListBean extends BaseBean
{
	private String productId;
	
	private Product product;
	
	private List records;

	
	/**
	 * @return Returns the records.
	 */
	public List getRecords()
	{
		return records;
	}

	/**
	 * @param records The records to set.
	 */
	public void setRecords(List records)
	{
		this.records = records;
	}

	/**
	 * @return Returns the productId.
	 */
	public String getProductId()
	{
		return productId;
	}

	/**
	 * @param productId The productId to set.
	 */
	public void setProductId(String productId)
	{
		this.productId = productId;
	}

	/**
	 * @return Returns the product.
	 */
	public Product getProduct()
	{
		return product;
	}

	/**
	 * @param product The product to set.
	 */
	public void setProduct(Product product)
	{
		this.product = product;
	}

	public void init()
	{
		this.logger.info( "Initialize the RecordListBean!" );
		
		if( this.productId!=null )
		{
			try
			{
				this.product = this.getServiceLocator().getProductService().getProduct( this.productId );
				
				this.records = ViewUtils.convertToList( product.getRecords() );
			}
			catch( LibraryException ex )
			{
				
			}
		}
	}
	
	public String listAction()
	{
		this.logger.info( "The method listAction in RecordListBean was invoked!");
		
		return NavigationResults.RECORD_LIST;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?