KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > impl > XSWildcardImpl


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.impl;
18
19 import org.apache.ws.jaxme.xs.XSAnnotation;
20 import org.apache.ws.jaxme.xs.XSObject;
21 import org.apache.ws.jaxme.xs.XSWildcard;
22 import org.apache.ws.jaxme.xs.xml.XsEAnnotation;
23 import org.apache.ws.jaxme.xs.xml.XsNamespaceList;
24 import org.apache.ws.jaxme.xs.xml.XsSchemaHeader;
25 import org.apache.ws.jaxme.xs.xml.XsTWildcard;
26 import org.xml.sax.SAXException JavaDoc;
27
28
29 /**
30  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
31  */

32 public class XSWildcardImpl extends XSOpenAttrsImpl implements XSWildcard {
33     private boolean isValidated;
34     private XSAnnotation[] annotations;
35     private final XsEAnnotation xsAnnotation;
36     
37     protected XSWildcardImpl(XSObject pParent, XsTWildcard pBaseObject) {
38         super(pParent, pBaseObject);
39         xsAnnotation = pBaseObject.getAnnotation();
40     }
41     
42     public XsNamespaceList getNamespaceList() {
43         return ((XsTWildcard) getXsObject()).getNamespace();
44     }
45
46     public XsTWildcard.ProcessContents getProcessContents() {
47         return ((XsTWildcard) getXsObject()).getProcessContents();
48     }
49
50     protected boolean isValidated() {
51         return isValidated;
52     }
53
54     public void validate() throws SAXException JavaDoc {
55         if (isValidated()) {
56             return;
57         } else {
58             isValidated = true;
59         }
60
61         if (xsAnnotation == null) {
62             annotations = new XSAnnotation[0];
63         } else {
64             XSAnnotation ann = getXSSchema().getXSObjectFactory().newXSAnnotation(this, xsAnnotation);
65             annotations = new XSAnnotation[]{ ann };
66             ann.validate();
67         }
68     }
69
70     public XsSchemaHeader getSchemaHeader() {
71         return getXsObject().getXsESchema();
72     }
73
74     public XSAnnotation[] getAnnotations() {
75         return annotations;
76     }
77 }
78
Popular Tags