KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > datatype > xsd > PatternRestrictDatatype


1 package com.thaiopensource.datatype.xsd;
2
3 import com.thaiopensource.datatype.xsd.regex.Regex;
4
5 class PatternRestrictDatatype extends RestrictDatatype {
6   private final Regex pattern;
7
8   PatternRestrictDatatype(DatatypeBase base, Regex pattern) {
9     super(base);
10     this.pattern = pattern;
11   }
12
13   boolean lexicallyAllows(String JavaDoc str) {
14     return pattern.matches(str) && super.lexicallyAllows(str);
15   }
16 }
17
Popular Tags