KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > xml > impl > XsETotalDigitsImpl


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

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.XsETotalDigits;
21 import org.apache.ws.jaxme.xs.xml.XsObject;
22 import org.xml.sax.SAXException JavaDoc;
23
24
25 /** <p>Implementation of <code>xs:totalDigits</code>,
26  * following this specification:
27  * <pre>
28  * &lt;xs:element name="totalDigits" id="totalDigits"&gt;
29  * &lt;xs:annotation&gt;
30  * &lt;xs:documentation
31  * source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/&gt;
32  * &lt;/xs:annotation&gt;
33  * &lt;xs:complexType&gt;
34  * &lt;xs:complexContent&gt;
35  * &lt;xs:restriction base="xs:numFacet"&gt;
36  * &lt;xs:sequence&gt;
37  * &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
38  * &lt;/xs:sequence&gt;
39  * &lt;xs:attribute name="value" type="xs:positiveInteger" use="required"/&gt;
40  * &lt;/xs:restriction&gt;
41  * &lt;/xs:complexContent&gt;
42  * &lt;/xs:complexType&gt;
43  * &lt;/xs:element&gt;
44  * </pre></p>
45  *
46  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
47  */

48 public class XsETotalDigitsImpl extends XsTNumFacetImpl implements XsETotalDigits {
49   protected XsETotalDigitsImpl(XsObject pParent) {
50     super(pParent);
51   }
52
53   public void setValue(long pValue) throws SAXException {
54     if (pValue <= 0) {
55       throw new LocSAXException("The 'value' attribute must be > 0.", getLocator());
56     }
57     super.setValue(pValue);
58   }
59
60   public String JavaDoc getFacetName() {
61     return "totalDigits";
62   }
63 }
64
Popular Tags