01: /*
02: * The contents of this file are subject to the terms
03: * of the Common Development and Distribution License
04: * (the "License"). You may not use this file except
05: * in compliance with the License.
06: *
07: * You can obtain a copy of the license at
08: * https://jwsdp.dev.java.net/CDDLv1.0.html
09: * See the License for the specific language governing
10: * permissions and limitations under the License.
11: *
12: * When distributing Covered Code, include this CDDL
13: * HEADER in each file and include the License file at
14: * https://jwsdp.dev.java.net/CDDLv1.0.html If applicable,
15: * add the following below this CDDL HEADER, with the
16: * fields enclosed by brackets "[]" replaced with your
17: * own identifying information: Portions Copyright [yyyy]
18: * [name of copyright owner]
19: */
20: package com.sun.xml.xsom;
21:
22: /**
23: * Model group.
24: *
25: * @author
26: * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
27: */
28: public interface XSModelGroup extends XSComponent, XSTerm,
29: Iterable<XSParticle> {
30: /**
31: * Type-safe enumeration for kind of model groups.
32: * Constants are defined in the {@link XSModelGroup} interface.
33: */
34: public static enum Compositor {
35: ALL("all"), CHOICE("choice"), SEQUENCE("sequence");
36:
37: private Compositor(String _value) {
38: this .value = _value;
39: }
40:
41: private final String value;
42:
43: /**
44: * Returns the human-readable compositor name.
45: *
46: * @return
47: * Either "all", "sequence", or "choice".
48: */
49: public String toString() {
50: return value;
51: }
52: }
53:
54: /**
55: * A constant that represents "all" compositor.
56: */
57: static final Compositor ALL = Compositor.ALL;
58: /**
59: * A constant that represents "sequence" compositor.
60: */
61: static final Compositor SEQUENCE = Compositor.SEQUENCE;
62: /**
63: * A constant that represents "choice" compositor.
64: */
65: static final Compositor CHOICE = Compositor.CHOICE;
66:
67: Compositor getCompositor();
68:
69: /**
70: * Gets <i>i</i>-ith child.
71: */
72: XSParticle getChild(int idx);
73:
74: /**
75: * Gets the number of children.
76: */
77: int getSize();
78:
79: /**
80: * Gets all the children in one array.
81: */
82: XSParticle[] getChildren();
83: }
|