📄 insuranceinfo.java
字号:
package coreservlets.beans;
import coreservlets.*;
/** Simple bean that represents information needed to
* calculate an employee's insurance costs. Has String,
* int, and boolean properties. Used to demonstrate
* automatically filling in bean properties from request
* parameters.
* <P>
* Taken from Core Servlets and JavaServer Pages 2nd Edition
* from Prentice Hall and Sun Microsystems Press,
* http://www.coreservlets.com/.
* © 2003 Marty Hall; may be freely used or adapted.
*/
public class InsuranceInfo {
private String name = "No name specified";
private String employeeID = "No ID specified";
private int numChildren = 0;
private boolean isMarried = false;
public String getName() {
return(name);
}
/** Just in case user enters special HTML characters,
* filter them out before storing the name.
*/
public void setName(String name) {
this.name = ServletUtilities.filter(name);
}
public String getEmployeeID() {
return(employeeID);
}
/** Just in case user enters special HTML characters,
* filter them out before storing the name.
*/
public void setEmployeeID(String employeeID) {
this.employeeID = ServletUtilities.filter(employeeID);
}
public int getNumChildren() {
return(numChildren);
}
public void setNumChildren(int numChildren) {
this.numChildren = numChildren;
}
/** Bean convention: name getter method "isXxx" instead
* of "getXxx" for boolean methods.
*/
public boolean isMarried() {
return(isMarried);
}
public void setMarried(boolean isMarried) {
this.isMarried = isMarried;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -