KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > schema > ModelGroup


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.schema;
24
25 /**
26  * class for Model Group.
27  *
28  * <p>This is the implementation of the Model Group.
29  * The following properties are defined:</p>
30  * <p> 1. compositor : one of {SEQUENCE, CHOICE, ALL}.</p>
31  * <p> 2. particles : a list of particles. This class is derived from ArrayList,
32  * a particle can be added directly in this class</p>
33  *
34  * <p>See XML Schema Part 1: Structures 3.8
35  * W3C Recommendation 2 May 2001</p>
36  *
37  * @see org.xquark.xml.schema.Particle
38  */

39 public class ModelGroup extends java.util.ArrayList JavaDoc implements SchemaVisitable {
40 private static final String JavaDoc RCSRevision = "$Revision: 1.1 $";
41 private static final String JavaDoc RCSName = "$Name: $";
42   
43   public static final int SEQUENCE = 0;
44   public static final int CHOICE = 1;
45   public static final int ALL = 2;
46
47   private int compositor;
48
49   /**
50    * Create a new ModelGroup.
51    * This is a default constructor, compositor = SEQUENCE
52    *
53    * @param
54    */

55   ModelGroup() {
56     this(SEQUENCE);
57   }
58
59   /**
60    * Create a new ModelGroup.
61    *
62    * @param comp The compositor, one of {SEQUENCE, CHOICE, ALL}.
63    */

64   ModelGroup(int comp) {
65     this.compositor = comp;
66   }
67
68   public void accept(SchemaVisitor visitor) throws SchemaException {
69     visitor.visit(this);
70   }
71
72   /**
73    * Look up the model group's compositor.
74    *
75    * @return The compositor, one of {SEQUENCE, CHOICE, ALL}.
76    */

77   public int getCompositor() {
78     return compositor;
79   }
80 }
81
Popular Tags