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 70 public class NCName extends Name 71 { 72 73 public NCName() 74 { 75 super(); 76 } 77 78 83 public NCName(String stValue) throws IllegalArgumentException 84 { 85 try 86 { 87 setValue(stValue); 88 } 89 catch (IllegalArgumentException e) 90 { 91 throw new IllegalArgumentException (Messages.getMessage("badNCNameType00") + "data=[" + 93 stValue + "]"); 94 } 95 } 96 97 98 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.isNCNameStart(stValue.charAt(scan)); 113 else 114 bValid = XMLChar.isNCName(stValue.charAt(scan)); 115 if (bValid == false) 116 break; 117 } 118 return bValid; 119 } 120 } 121 | Popular Tags |