1 55 package org.jboss.axis.types; 56 57 58 import org.jboss.axis.utils.Messages; 59 import org.jboss.axis.utils.XMLChar; 60 61 71 public class Name extends Token 72 { 73 74 public Name() 75 { 76 super(); 77 } 78 79 84 public Name(String stValue) throws IllegalArgumentException 85 { 86 try 87 { 88 setValue(stValue); 89 } 90 catch (IllegalArgumentException e) 91 { 92 throw new IllegalArgumentException (Messages.getMessage("badNameType00") + "data=[" + 94 stValue + "]"); 95 } 96 } 97 98 99 104 public boolean isValid(String stValue) 105 { 106 int scan; 107 boolean bValid = true; 108 109 for (scan = 0; scan < stValue.length(); scan++) 110 { 111 if (scan == 0) 112 bValid = XMLChar.isNameStart(stValue.charAt(scan)); 113 else 114 bValid = XMLChar.isName(stValue.charAt(scan)); 115 if (bValid == false) 116 break; 117 } 118 119 return bValid; 120 } 121 } 122 | Popular Tags |