KickJava   Java API By Example, From Geeks To Geeks.

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


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.XsObject;
21 import org.xml.sax.SAXException JavaDoc;
22
23
24 /** <p>Implementation of a facet, following this specification:
25  * <pre>
26  * &lt;xs:complexType name="facet"&gt;
27  * &lt;xs:complexContent&gt;
28  * &lt;xs:extension base="xs:annotated"&gt;
29  * &lt;xs:attribute name="value" use="required"/&gt;
30  * &lt;xs:attribute name="fixed" type="xs:boolean" use="optional"
31  * default="false"/&gt;
32  * &lt;/xs:extension&gt;
33  * &lt;/xs:complexContent&gt;
34  * &lt;/xs:complexType&gt;
35  * </pre></p>
36  *
37  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
38  */

39 public abstract class XsTFacetImpl extends XsTFixedFacetImpl {
40   private String JavaDoc value;
41
42   protected XsTFacetImpl(XsObject pParent) {
43     super(pParent);
44   }
45
46   public void setValue(String JavaDoc pValue) {
47     value = pValue;
48   }
49
50   public String JavaDoc getValue() {
51     return value;
52   }
53
54   public void validate() throws SAXException {
55     super.validate();
56     if (value == null) {
57       throw new LocSAXException("Missing 'value' attribute", getLocator());
58     }
59   }
60 }
61
Popular Tags