01: /* CVS ID: $Id: IntegerConfigParameter.java,v 1.1.1.1 2002/10/02 18:41:45 wastl Exp $ */
02: package net.wastl.webmail.config;
03:
04: /*
05: * ConfigIntegerParameter.java
06: *
07: * Created: Sun Oct 3 17:45:08 1999
08: *
09: * Copyright (C) 2000 Sebastian Schaffert
10: *
11: * This program is free software; you can redistribute it and/or
12: * modify it under the terms of the GNU General Public License
13: * as published by the Free Software Foundation; either version 2
14: * of the License, or (at your option) any later version.
15: *
16: * This program is distributed in the hope that it will be useful,
17: * but WITHOUT ANY WARRANTY; without even the implied warranty of
18: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19: * GNU General Public License for more details.
20: *
21: * You should have received a copy of the GNU General Public License
22: * along with this program; if not, write to the Free Software
23: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24: */
25: /**
26: *
27: * @author Sebastian Schaffert
28: * @version
29: */
30:
31: public class IntegerConfigParameter extends ConfigParameter {
32:
33: public IntegerConfigParameter(String name, String def, String desc) {
34: super (name, def, desc);
35: }
36:
37: public boolean isPossibleValue(Object value) {
38: try {
39: int i = Integer.parseInt((String) value);
40: return true;
41: } catch (NumberFormatException e) {
42: return false;
43: }
44: }
45:
46: public String getType() {
47: return "integer";
48: }
49: } // ConfigIntegerParameter
|