KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > XSModelGroup


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;
18
19 import org.xml.sax.Locator JavaDoc;
20 import org.xml.sax.SAXException JavaDoc;
21
22
23 /** <p>Interface of a model group. A model group is, for example,
24  * defined by an <code>xs:group</code> element, or by a complex type
25  * without simpleContent or complexContent.</p>
26  *
27  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
28  */

29 public interface XSModelGroup {
30   public class Compositor {
31     private String JavaDoc name;
32     Compositor(String JavaDoc pName) {
33       name = pName;
34     }
35     public String JavaDoc toString() { return name; }
36     public boolean equals(Object JavaDoc o) {
37       return o != null && o instanceof Compositor && ((Compositor) o).name.equals(name);
38     }
39     public int hashCode() { return name.hashCode(); }
40   }
41
42   /** <p>The sequence compositor.</p>
43    */

44   public static final Compositor SEQUENCE = new Compositor("sequence");
45
46   /** <p>The choice compositor.</p>
47    */

48   public static final Compositor CHOICE = new Compositor("choice");
49
50   /** <p>The all compositor.</p>
51    */

52   public static final Compositor ALL = new Compositor("all");
53
54   /** <p>Returns the model groups compositor.</p>
55    */

56   public Compositor getCompositor();
57
58   /** <p>Shortcut for <code>getCompositor().equals(SEQUENCE)</code>.</p>
59    * @see #getCompositor()
60    * @see #SEQUENCE
61    */

62   public boolean isSequence();
63
64   /** <p>Shortcut for <code>getCompositor().equals(CHOICE)</code>.</p>
65    * @see #getCompositor()
66    * @see #CHOICE
67    */

68   public boolean isChoice();
69
70   /** <p>Shortcut for <code>getCompositor().equals(ALL)</code>.</p>
71    * @see #getCompositor()
72    * @see #ALL
73    */

74   public boolean isAll();
75
76   /** <p>Returns the model groups particles.</p>
77    */

78   public XSParticle[] getParticles();
79
80   /** <p>Returns the model groups locator.</p>
81    */

82   public Locator JavaDoc getLocator();
83
84   /** <p>Validates the particles contents.</p>
85    */

86   public void validate() throws SAXException JavaDoc;
87 }
88
Popular Tags