propertydef.java

来自「这个weblogging 设计得比较精巧」· Java 代码 · 共 106 行

JAVA
106
字号
/* * PropertyDef.java * * Created on June 4, 2005, 1:13 PM */package org.roller.config.runtime;/** * Represents the definition of a single runtime property. * * Each property definition may contain these elements *   - name (required) *   - key (required) *   - type (required) *   - default-value (required) *   - rows (optional) *   - cols (options) * * @author Allen Gilliland */public class PropertyDef {        private String name = null;    private String key = null;    private String type = null;    private String defaultValue = null;    private int rows = 5;    private int cols = 25;            /** Creates a new instance of PropertyDef */    public PropertyDef() {}    public String toString() {        return "["+name+","+key+","+type+","+defaultValue+","+rows+","+cols+"]";    }        public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public String getKey() {        return key;    }    public void setKey(String key) {        this.key = key;    }    public String getType() {        return type;    }    public void setType(String type) {        this.type = type;    }    public String getDefaultValue() {        return defaultValue;    }    public void setDefaultValue(String defaultvalue) {        this.defaultValue = defaultvalue;    }    public int getRows() {        return rows;    }    public void setRows(int rows) {        this.rows = rows;    }    public void setRows(String rows) {        //convert to int        try {            int r = Integer.parseInt(rows);            this.rows = r;        } catch(Exception e) {            // hmmm ... bogus value        }    }    public int getCols() {        return cols;    }    public void setCols(int cols) {        this.cols = cols;    }        public void setCols(String cols) {        //convert to int        try {            int c = Integer.parseInt(cols);            this.cols = c;        } catch(Exception e) {            // hmmm ... bogus value        }    }}

⌨️ 快捷键说明

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