KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > dom3 > as > ASContentModel


1 /*
2  * Copyright (c) 2001 World Wide Web Consortium,
3  * (Massachusetts Institute of Technology, Institut National de
4  * Recherche en Informatique et en Automatique, Keio University). All
5  * Rights Reserved. This program is distributed under the W3C's Software
6  * Intellectual Property License. This program is distributed in the
7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE.
10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11  */

12
13 package com.sun.org.apache.xerces.internal.dom3.as;
14
15 /**
16  * @deprecated
17  * The content model of a declared element.
18  * <p>See also the <a HREF='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model (DOM) Level 3 Abstract Schemas and Load
19 and Save Specification</a>.
20  */

21 public interface ASContentModel extends ASObject {
22     /**
23      * Signifies unbounded upper limit. The MAX_VALUE value is
24      * <code>0xFFFFFFFF FFFFFFFF</code>. This needs to be better defined in
25      * the generated bindings.
26      */

27     public static final int AS_UNBOUNDED = Integer.MAX_VALUE;
28     // ASContentModelType
29
/**
30      * This constant value signifies a sequence operator. For example, in a
31      * DTD, this would be the '<code>,</code>' operator.
32      */

33     public static final short AS_SEQUENCE = 0;
34     /**
35      * This constant value signifies a choice operator. For example, in a DTD,
36      * this would be the '<code>|</code>' operator.
37      */

38     public static final short AS_CHOICE = 1;
39     /**
40      * All of the above.
41      */

42     public static final short AS_ALL = 2;
43     /**
44      * None of the above, i.e., neither a choice nor sequence operator.
45      */

46     public static final short AS_NONE = 3;
47
48     /**
49      * One of <code>AS_CHOICE</code>, <code>AS_SEQUENCE</code>,
50      * <code>AS_ALL</code> or <code>AS_NONE</code>. The operator is applied
51      * to all the components(ASObjects) in the <code>subModels</code>. For
52      * example, if the list operator is <code>AS_CHOICE</code> and the
53      * components in subModels are a, b and c then the abstract schema for
54      * the element being declared is <code>(a|b|c)</code>.
55      */

56     public short getListOperator();
57     /**
58      * One of <code>AS_CHOICE</code>, <code>AS_SEQUENCE</code>,
59      * <code>AS_ALL</code> or <code>AS_NONE</code>. The operator is applied
60      * to all the components(ASObjects) in the <code>subModels</code>. For
61      * example, if the list operator is <code>AS_CHOICE</code> and the
62      * components in subModels are a, b and c then the abstract schema for
63      * the element being declared is <code>(a|b|c)</code>.
64      */

65     public void setListOperator(short listOperator);
66
67     /**
68      * min occurrence for this content particle. Its value may be 0 or a
69      * positive integer.
70      */

71     public int getMinOccurs();
72     /**
73      * min occurrence for this content particle. Its value may be 0 or a
74      * positive integer.
75      */

76     public void setMinOccurs(int minOccurs);
77
78     /**
79      * maximum occurrence for this content particle. Its value may be
80      * <code>0</code>, a positive integer, or <code>AS_UNBOUNDED</code> to
81      * indicate that no upper limit has been set.
82      */

83     public int getMaxOccurs();
84     /**
85      * maximum occurrence for this content particle. Its value may be
86      * <code>0</code>, a positive integer, or <code>AS_UNBOUNDED</code> to
87      * indicate that no upper limit has been set.
88      */

89     public void setMaxOccurs(int maxOccurs);
90
91     /**
92      * Pointers to <code>ASObject</code>s such as
93      * <code> ASElementDeclaration</code>s and further
94      * <code>ASContentModel</code>s.
95      */

96     public ASObjectList getSubModels();
97     /**
98      * Pointers to <code>ASObject</code>s such as
99      * <code> ASElementDeclaration</code>s and further
100      * <code>ASContentModel</code>s.
101      */

102     public void setSubModels(ASObjectList subModels);
103
104     /**
105      * Removes the <code>ASObject</code> in the submodel. Nodes that already
106      * exist in the list are moved as needed.
107      * @param oldNode The node to be removed.
108      */

109     public void removesubModel(ASObject oldNode);
110
111     /**
112      * Inserts a new node in the submodel. Nodes that already exist in the
113      * list are moved as needed.
114      * @param newNode The new node to be inserted.
115      * @exception DOMASException
116      * <code>DUPLICATE_NAME_ERR</code>: Raised if a element declaration
117      * already exists with the same name within an <code>AS_CHOICE</code>
118      * operator.
119      */

120     public void insertsubModel(ASObject newNode)
121                                throws DOMASException;
122
123     /**
124      * Appends a new node to the end of the list representing the
125      * <code>subModels</code>.
126      * @param newNode The new node to be appended.
127      * @return the length of the <code>subModels</code>.
128      * @exception DOMASException
129      * <code>DUPLICATE_NAME_ERR</code>: Raised if a element declaration
130      * already exists with the same name within an <code>AS_CHOICE</code>
131      * operator.
132      * <br> <code>TYPE_ERR</code>: Raised if type is neither an
133      * <code>ASContentModel</code> nor an <code>ASElementDeclaration</code>
134      * .
135      */

136     public int appendsubModel(ASObject newNode)
137                               throws DOMASException;
138
139 }
140
Popular Tags