KickJava   Java API By Example, From Geeks To Geeks.

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


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
21
22 /** <p>Interface of the <code>xs:selector</code> element, specified
23  * by the following:
24  * <pre>
25  * <xs:element name="selector" id="selector">
26  * <xs:annotation>
27  * <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
28  * </xs:annotation>
29  * <xs:complexType>
30  * <xs:complexContent>
31  * <xs:extension base="xs:annotated">
32  * <xs:attribute name="xpath" use="required">
33  * <xs:simpleType>
34  * <xs:annotation>
35  * <xs:documentation>
36  * A subset of XPath expressions for use
37  * in selectors
38  * </xs:documentation>
39  * <xs:documentation>
40  * A utility type, not for public use
41  * </xs:documentation>
42  * </xs:annotation>
43  * <xs:restriction base="xs:token">
44  * <xs:annotation>
45  * <xs:documentation>
46  * The following pattern is intended to allow XPath
47  * expressions per the following EBNF:
48  * Selector ::= Path ( '|' Path )*
49  * Path ::= ('.//')? Step ( '/' Step )*
50  * Step ::= '.' | NameTest
51  * NameTest ::= QName | '*' | NCName ':' '*'
52  * child:: is also allowed
53  * </xs:documentation>
54  * </xs:annotation>
55  * <xs:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*">
56  * </xs:pattern>
57  * </xs:restriction>
58  * </xs:simpleType>
59  * </xs:attribute>
60  * </xs:extension>
61  * </xs:complexContent>
62  * </xs:complexType>
63  * </xs:element>
64  * </pre></p>
65  *
66  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
67  */

68 public class XsESelectorImpl extends XsTAnnotatedImpl implements XsESelector {
69   private XsToken xpath;
70
71   protected XsESelectorImpl(XsObject pParent) {
72     super(pParent);
73   }
74
75   public void setXpath(XsToken pXpath) {
76     xpath = pXpath;
77   }
78
79   public XsToken getXpath() {
80     return xpath;
81   }
82
83   public void validate() {
84     if (getXpath() == null) {
85       throw new NullPointerException JavaDoc("Missing attribute: xpath");
86     }
87   }
88 }
89
Popular Tags