⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 news.java

📁 新闻管理系统
💻 JAVA
字号:
/*
 * Created on 2007-4-16
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package cn.edu.zucc.news.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.struts.action.ActionForm;

/**
 * @author wengwy
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class News extends ActionForm implements Serializable {
    private String newsid="";
    private String newsTitle="";
    private String newsContent="";
    private String newsAutor="";
    private String isurl="n";
    private String newsTypeId="";
    private String newsTypaName="";
    private Date createDate=null;
    private int readcount = 0;
    private Date recentReadDate = null;
    private String method="addNewsResult"; //用于表示该对象下一步的处理方法
    //建立虚拟的属性strCreateDate,该属性的值和createDate保持一致,
    //其目的是自动完成页面字符串数据与javabean中的时间数据的自动转换
    public String getStrCreateDate(){
        if(createDate==null) return "";
        SimpleDateFormat df =new SimpleDateFormat("yyyy-mm-dd");
        return df.format(createDate);
    }
    public void setStrCreateDate(String val){
        
        SimpleDateFormat df =new SimpleDateFormat("yyyy-mm-dd");
        try{
            this.createDate=df.parse(val);
        }
        catch(Exception ex){
            this.createDate=null;
        }
    }
    public String getStrRecentReadDate(){
        if(recentReadDate==null) return "";
        SimpleDateFormat df =new SimpleDateFormat("yyyy-mm-dd");
        return df.format(recentReadDate);
    }
    public void setStrRecentReadDate(String val){
        
        SimpleDateFormat df =new SimpleDateFormat("yyyy-mm-dd");
        try{
            this.recentReadDate=df.parse(val);
        }
        catch(Exception ex){
            this.recentReadDate=null;
        }
    }
    public String getStrReadcount(){
        return " "+this.readcount;
    }
    /**
     * @return Returns the createDate.
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * @param createDate
     *            The createDate to set.
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * @return Returns the isurl.
     */
    public String getIsurl() {
        return isurl;
    }

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

    /**
     * @return Returns the newsAutor.
     */
    public String getNewsAutor() {
        return newsAutor;
    }

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

    /**
     * @return Returns the newsContent.
     */
    public String getNewsContent() {
        return newsContent;
    }

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

    /**
     * @return Returns the newsid.
     */
    public String getNewsid() {
        return newsid;
    }

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

    /**
     * @return Returns the newsTitle.
     */
    public String getNewsTitle() {
        return newsTitle;
    }

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

    /**
     * @return Returns the newsTypaName.
     */
    public String getNewsTypaName() {
        return newsTypaName;
    }

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

    /**
     * @return Returns the newsTypeId.
     */
    public String getNewsTypeId() {
        return newsTypeId;
    }

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

    /**
     * @return Returns the readcount.
     */
    public int getReadcount() {
        return readcount;
    }

    /**
     * @param readcount
     *            The readcount to set.
     */
    public void setReadcount(int readcount) {
        this.readcount = readcount;
    }

    /**
     * @return Returns the recentReadDate.
     */
    public Date getRecentReadDate() {
        return recentReadDate;
    }

    /**
     * @param recentReadDate
     *            The recentReadDate to set.
     */
    public void setRecentReadDate(Date recentReadDate) {
        this.recentReadDate = recentReadDate;
    }

    
    /**
     * @return Returns the method.
     */
    public String getMethod() {
        return method;
    }
    /**
     * @param method The method to set.
     */
    public void setMethod(String method) {
        this.method = method;
    }
}

⌨️ 快捷键说明

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