1 17 package org.apache.ws.jaxme.xs.xml.impl; 18 19 import org.apache.ws.jaxme.xs.parser.impl.LocSAXException; 20 import org.apache.ws.jaxme.xs.xml.*; 21 import org.xml.sax.SAXException ; 22 23 40 public abstract class XsTNumFacetImpl extends XsTFixedFacetImpl 41 implements XsTNumFacet { 42 private long value = -1; 43 44 protected XsTNumFacetImpl(XsObject pParent) { 45 super(pParent); 46 } 47 48 public void setValue(long pValue) throws SAXException { 49 if (pValue < 0) { 50 throw new LocSAXException("The 'value' attribute must not be negative.", getLocator()); 51 } 52 value = pValue; 53 } 54 55 public long getValue() { 56 return value; 57 } 58 59 public void validate() throws SAXException { 60 super.validate(); 61 if (value == -1) { 62 throw new LocSAXException("Missing 'value' attribute.", getLocator()); 63 } 64 } 65 } 66 | Popular Tags |