KickJava   Java API By Example, From Geeks To Geeks.

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


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.xml.*;
20 import org.xml.sax.SAXException JavaDoc;
21
22
23 /** <p>Implementation of the <code>xs:keyref</code> element, with the
24  * following specification:
25  * <pre>
26  * <xs:element name="keyref" id="keyref">
27  * <xs:annotation>
28  * <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/>
29  * </xs:annotation>
30  * <xs:complexType>
31  * <xs:complexContent>
32  * <xs:extension base="xs:keybase">
33  * <xs:attribute name="refer" type="xs:QName" use="required"/>
34  * </xs:extension>
35  * </xs:complexContent>
36  * </xs:complexType>
37  * </xs:element>
38  * </pre></p>
39  *
40  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
41  */

42 public class XsEKeyrefImpl extends XsTKeybaseImpl implements XsEKeyref {
43   private XsQName refer;
44
45   protected XsEKeyrefImpl(XsObject pParent) {
46     super(pParent);
47   }
48
49   public void setRefer(XsQName pRefer) {
50     refer = pRefer;
51   }
52
53   public void setRefer(String JavaDoc pRefer) throws SAXException JavaDoc {
54     setRefer(asXsQName(pRefer));
55   }
56
57   public XsQName getRefer() {
58     return refer;
59   }
60
61   public void validate() {
62     super.validate();
63     if (getRefer() == null) {
64       throw new NullPointerException JavaDoc("Missing attribute: 'refer'");
65     }
66   }
67 }
68
Popular Tags