KickJava   Java API By Example, From Geeks To Geeks.

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


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 an <code>xs:attributeGroup</code>,
24  * with the following specification:
25  * <pre>
26  * &lt;xs:complexType name="attributeGroup" abstract="true"&gt;
27  * &lt;xs:complexContent&gt;
28  * &lt;xs:extension base="xs:annotated"&gt;
29  * &lt;xs:group ref="xs:attrDecls"/&gt;
30  * &lt;xs:attributeGroup ref="xs:defRef"/&gt;
31  * &lt;/xs:extension&gt;
32  * &lt;/xs:complexContent&gt;
33  * &lt;/xs:complexType&gt;
34  * </pre></p>
35  *
36  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
37  */

38 public class XsTAttributeGroupImpl extends XsTAnnotatedImpl implements XsTAttributeGroup {
39   private final XsGAttrDecls decls;
40   private final XsAGDefRef defRef;
41
42   protected XsTAttributeGroupImpl(XsObject pParent) {
43     super(pParent);
44     decls = getObjectFactory().newXsGAttrDecls(this);
45     defRef = getObjectFactory().newXsAGDefRef(this);
46   }
47
48   public void setName(XsNCName pName) {
49     defRef.setName(pName);
50   }
51
52   public XsNCName getName() {
53     return defRef.getName();
54   }
55
56   public void setRef(XsQName pRef) {
57     defRef.setRef(pRef);
58   }
59
60   public void setRef(String JavaDoc pRef) throws SAXException JavaDoc {
61     setRef(asXsQName(pRef));
62   }
63
64   public XsQName getRef() {
65     return defRef.getRef();
66   }
67
68   public XsTAttribute createAttribute() {
69     return decls.createAttribute();
70   }
71
72   public XsTAttribute[] getAttributes() {
73     return decls.getAttributes();
74   }
75
76   public XsTAttributeGroupRef createAttributeGroup() {
77     return decls.createAttributeGroup();
78   }
79
80   public XsTAttributeGroupRef[] getAttributeGroups() {
81     return decls.getAttributeGroups();
82   }
83
84   public XsTWildcard createAnyAttribute() {
85     return decls.createAnyAttribute();
86   }
87
88   public XsTWildcard getAnyAttribute() {
89     return decls.getAnyAttribute();
90   }
91
92   public Object JavaDoc[] getAllAttributes() {
93     return decls.getAllAttributes();
94   }
95
96   public void validate() throws SAXException JavaDoc {
97     super.validate();
98     defRef.validate();
99   }
100 }
101
Popular Tags