001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. The ASF licenses this file to You
004: * under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License. For additional information regarding
015: * copyright in this work, please see the NOTICE file in the top level
016: * directory of this distribution.
017: */
018: /*
019: * PropertyDef.java
020: *
021: * Created on June 4, 2005, 1:13 PM
022: */
023:
024: package org.apache.roller.config.runtime;
025:
026: /**
027: * Represents the definition of a single runtime property.
028: *
029: * Each property definition may contain these elements
030: * - name (required)
031: * - key (required)
032: * - type (required)
033: * - default-value (required)
034: * - rows (optional)
035: * - cols (options)
036: *
037: * @author Allen Gilliland
038: */
039: public class PropertyDef {
040:
041: private String name = null;
042: private String key = null;
043: private String type = null;
044: private String defaultValue = null;
045: private int rows = 5;
046: private int cols = 25;
047:
048: /** Creates a new instance of PropertyDef */
049: public PropertyDef() {
050: }
051:
052: public String toString() {
053: return "[" + name + "," + key + "," + type + "," + defaultValue
054: + "," + rows + "," + cols + "]";
055: }
056:
057: public String getName() {
058: return name;
059: }
060:
061: public void setName(String name) {
062: this .name = name;
063: }
064:
065: public String getKey() {
066: return key;
067: }
068:
069: public void setKey(String key) {
070: this .key = key;
071: }
072:
073: public String getType() {
074: return type;
075: }
076:
077: public void setType(String type) {
078: this .type = type;
079: }
080:
081: public String getDefaultValue() {
082: return defaultValue;
083: }
084:
085: public void setDefaultValue(String defaultvalue) {
086: this .defaultValue = defaultvalue;
087: }
088:
089: public int getRows() {
090: return rows;
091: }
092:
093: public void setRows(int rows) {
094: this .rows = rows;
095: }
096:
097: public void setRows(String rows) {
098: //convert to int
099: try {
100: int r = Integer.parseInt(rows);
101: this .rows = r;
102: } catch (Exception e) {
103: // hmmm ... bogus value
104: }
105: }
106:
107: public int getCols() {
108: return cols;
109: }
110:
111: public void setCols(int cols) {
112: this .cols = cols;
113: }
114:
115: public void setCols(String cols) {
116: //convert to int
117: try {
118: int c = Integer.parseInt(cols);
119: this .cols = c;
120: } catch (Exception e) {
121: // hmmm ... bogus value
122: }
123: }
124: }
|