KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.thaiopensource.datatype.xsd;
2
3 import com.thaiopensource.xml.util.Naming;
4
5 class NmtokenDatatype extends TokenDatatype {
6   public boolean lexicallyAllows(String JavaDoc str) {
7     return Naming.isNmtoken(str);
8   }
9   public int getLength(Object JavaDoc obj) {
10     // Surrogates are not possible in an NMTOKEN.
11
return ((String JavaDoc)obj).length();
12   }
13   public boolean alwaysValid() {
14     return false;
15   }
16 }
17
Popular Tags