KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.ArrayList JavaDoc;
20 import java.util.List JavaDoc;
21
22 import org.apache.ws.jaxme.xs.xml.XsEAny;
23 import org.apache.ws.jaxme.xs.xml.XsEChoice;
24 import org.apache.ws.jaxme.xs.xml.XsESequence;
25 import org.apache.ws.jaxme.xs.xml.XsObject;
26 import org.apache.ws.jaxme.xs.xml.XsTGroupRef;
27 import org.apache.ws.jaxme.xs.xml.XsTLocalElement;
28 import org.apache.ws.jaxme.xs.xml.XsTNestedParticle;
29 import org.apache.ws.jaxme.xs.xml.XsTSimpleExplicitGroup;
30
31 /**
32  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
33  */

34 public class XsTSimpleExplicitGroupImpl extends XsTAnnotatedImpl implements XsTSimpleExplicitGroup {
35   private final List JavaDoc particles = new ArrayList JavaDoc();
36
37   protected XsTSimpleExplicitGroupImpl(XsObject pParent) {
38     super(pParent);
39   }
40
41   protected void addParticle(XsTNestedParticle pParticle) {
42     particles.add(pParticle);
43   }
44
45   public XsTLocalElement createElement() {
46     XsTLocalElement element = getObjectFactory().newXsTLocalElement(this);
47     addParticle(element);
48     return element;
49   }
50
51   public XsTGroupRef createGroup() {
52     XsTGroupRef groupRef = getObjectFactory().newXsTGroupRef(this);
53     addParticle(groupRef);
54     return groupRef;
55   }
56
57   public XsEChoice createChoice() {
58     XsEChoice choice = getObjectFactory().newXsEChoice(this);
59     addParticle(choice);
60     return choice;
61   }
62
63   public XsESequence createSequence() {
64     XsESequence sequence = getObjectFactory().newXsESequence(this);
65     addParticle(sequence);
66     return sequence;
67   }
68
69   public XsEAny createAny() {
70     XsEAny any = getObjectFactory().newXsEAny(this);
71     addParticle(any);
72     return any;
73   }
74
75   public XsTNestedParticle[] getParticles() {
76     return (XsTNestedParticle[]) particles.toArray(new XsTNestedParticle[particles.size()]);
77   }
78 }
79
Popular Tags