KickJava   Java API By Example, From Geeks To Geeks.

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


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