Last change
on this file since 52 was 52, checked in by ruud, 14 months ago |
Fixed small issues in domaineditor.
|
File size:
565 bytes
|
Line | |
---|
1 | package geniusweb.domaineditor.model;
|
---|
2 |
|
---|
3 | import tudelft.utilities.logging.Reporter;
|
---|
4 | import tudelft.utilities.mvc.model.StringModel;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * allows only strings that {{{matches("[a-zA-Z0-9]+")}}}
|
---|
8 | */
|
---|
9 | public class SimpleStringModel extends StringModel {
|
---|
10 |
|
---|
11 | public SimpleStringModel(String val, Reporter log) {
|
---|
12 | super(val, log);
|
---|
13 | }
|
---|
14 |
|
---|
15 | @Override
|
---|
16 | protected void check() throws IllegalStateException {
|
---|
17 | if (!(getValue().matches("[a-zA-Z0-9]+")))
|
---|
18 | throw new IllegalStateException(
|
---|
19 | "Only lower and upper case letters and numbers are allowed");
|
---|
20 | super.check();
|
---|
21 | }
|
---|
22 |
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.