1 17 package org.apache.ws.jaxme.xs.xml; 18 19 23 public class XsNCName { 24 private final String value; 25 26 public XsNCName(String pValue) { 27 if (pValue == null || pValue.length() == 0) { 28 throw new NullPointerException ("An NCName cannot be null or empty."); 29 } 30 if (pValue.indexOf(':') >= 0) { 31 throw new IllegalArgumentException ("NCName " + pValue + " is invalid, because it contains a namespace prefix"); 32 } 33 value = pValue; 34 } 35 36 public String toString() { return value; } 37 public String getValue() { return value; } 38 public int hashCode() { return value.hashCode(); } 39 public boolean equals(Object o) { 40 return o != null && o instanceof XsNCName && value.equals(((XsNCName) o).value); 41 } 42 } 43 | Popular Tags |