KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > dom3 > as > ASModel


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 org.apache.xerces.dom3.as;
14
15 import org.w3c.dom.DOMException JavaDoc;
16
17 /**
18  * @deprecated
19  * To begin with, an abstract schema is a generic structure that could
20  * contain both internal and external subsets. An <code>ASModel</code> is an
21  * abstract object that could map to a DTD , an XML Schema , a database
22  * schema, etc. An <code>ASModel</code> could represent either an internal
23  * or an external subset; hence an abstract schema could be composed of an
24  * <code>ASModel</code> representing the internal subset and an
25  * <code>ASModel</code> representing the external subset. Note that the
26  * <code>ASModel</code> representing the external subset could consult the
27  * <code>ASModel</code> representing the internal subset. Furthermore, the
28  * <code>ASModel</code> representing the internal subset could be set to
29  * null by the <code>setInternalAS</code> method as a mechanism for
30  * "removal". In addition, only one <code>ASModel</code> representing the
31  * external subset can be specified as "active" and it is possible that none
32  * are "active". Finally, the <code>ASModel</code> contains the factory
33  * methods needed to create a various types of ASObjects like
34  * <code>ASElementDeclaration</code>, <code>ASAttributeDeclaration</code>,
35  * etc.
36  * <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
37 and Save Specification</a>.
38  */

39 public interface ASModel extends ASObject {
40     /**
41      * <code>true</code> if this <code>ASModel</code> defines the document
42      * structure in terms of namespaces and local names ; <code>false</code>
43      * if the document structure is defined only in terms of
44      * <code>QNames</code>.
45      */

46     public boolean getIsNamespaceAware();
47
48     /**
49      * 0 if used internally, 1 if used externally, 2 if not all. An exception
50      * will be raised if it is incompatibly shared or in use as an internal
51      * subset.
52      */

53     public short getUsageLocation();
54
55     /**
56      * The URI reference.
57      */

58     public String JavaDoc getAsLocation();
59     /**
60      * The URI reference.
61      */

62     public void setAsLocation(String JavaDoc asLocation);
63
64     /**
65      * The hint to locating an ASModel.
66      */

67     public String JavaDoc getAsHint();
68     /**
69      * The hint to locating an ASModel.
70      */

71     public void setAsHint(String JavaDoc asHint);
72
73     /**
74      * Instead of returning an all-in-one <code>ASObject</code> with
75      * <code>ASModel</code> methods, have discernible top-level/"global"
76      * element declarations. If one attempts to add, set, or remove a node
77      * type other than the intended one, a hierarchy exception (or
78      * equivalent is thrown).
79      */

80     public ASNamedObjectMap getElementDeclarations();
81
82     /**
83      * Instead of returning an all-in-one <code>ASObject</code> with
84      * <code>ASModel</code> methods, have discernible top-level/"global"
85      * attribute declarations. If one attempts to add, set, or remove a node
86      * type other than the intended one, a hierarchy exception (or
87      * equivalent is thrown).
88      */

89     public ASNamedObjectMap getAttributeDeclarations();
90
91     /**
92      * Instead of returning an all-in-one <code>ASObject</code> with
93      * <code>ASModel</code> methods, have discernible top-level/"global"
94      * notation declarations. If one attempts to add, set, or remove a node
95      * type other than the intended one, a hierarchy exception (or
96      * equivalent is thrown).
97      */

98     public ASNamedObjectMap getNotationDeclarations();
99
100     /**
101      * Instead of returning an all-in-one <code>ASObject</code> with
102      * <code>ASModel</code> methods, have discernible top-level/"global"
103      * entity declarations. If one attempts to add, set, or remove a node
104      * type other than the intended one, a hierarchy exception (or
105      * equivalent is thrown).
106      */

107     public ASNamedObjectMap getEntityDeclarations();
108
109     /**
110      * Instead of returning an all-in-one <code>ASObject</code> with
111      * <code>ASModel</code> methods, have discernible top-level/"global
112      * content model declarations. If one attempts to add, set, or remove a
113      * node type other than the intended one, a hierarchy exception (or
114      * equivalent is thrown).
115      */

116     public ASNamedObjectMap getContentModelDeclarations();
117
118     /**
119      * This method will allow the nesting or "importation" of ASModels.
120      * @param abstractSchema ASModel to be set. Subsequent calls will nest
121      * the ASModels within the specified <code>ownerASModel</code>.
122      */

123     public void addASModel(ASModel abstractSchema);
124
125     /**
126      * To retrieve a list of nested ASModels without reference to names.
127      * @return A list of ASModels.
128      */

129     public ASObjectList getASModels();
130
131     /**
132      * Removes only the specified <code>ASModel</code> from the list of
133      * <code>ASModel</code>s.
134      * @param as AS to be removed.
135      */

136     public void removeAS(ASModel as);
137
138     /**
139      * Determines if an <code>ASModel</code> itself is valid, i.e., confirming
140      * that it's well-formed and valid per its own formal grammar.
141      * @return <code>true</code> if the <code>ASModel</code> is valid,
142      * <code>false</code> otherwise.
143      */

144     public boolean validate();
145
146     /**
147      * Creates an element declaration for the element type specified.
148      * @param namespaceURI The <code>namespace URI</code> of the element type
149      * being declared.
150      * @param name The name of the element. The format of the name could be
151      * an NCName as defined by XML Namespaces or a Name as defined by XML
152      * 1.0; it's ASModel-dependent.
153      * @return A new <code>ASElementDeclaration</code> object with
154      * <code>name</code> attribute set to <code>tagname</code> and
155      * <code>namespaceURI</code> set to <code>systemId</code>. Other
156      * attributes of the element declaration are set through
157      * <code>ASElementDeclaration</code> interface methods.
158      * @exception DOMException
159      * INVALID_CHARACTER_ERR: Raised if the specified name contains an
160      * illegal character.
161      */

162     public ASElementDeclaration createASElementDeclaration(String JavaDoc namespaceURI,
163                                                            String JavaDoc name)
164                                                            throws DOMException JavaDoc;
165
166     /**
167      * Creates an attribute declaration.
168      * @param namespaceURI The namespace URI of the attribute being declared.
169      * @param name The name of the attribute. The format of the name could be
170      * an NCName as defined by XML Namespaces or a Name as defined by XML
171      * 1.0; it's ASModel-dependent.
172      * @return A new <code>ASAttributeDeclaration</code> object with
173      * appropriate attributes set by input parameters.
174      * @exception DOMException
175      * INVALID_CHARACTER_ERR: Raised if the input <code>name</code>
176      * parameter contains an illegal character.
177      */

178     public ASAttributeDeclaration createASAttributeDeclaration(String JavaDoc namespaceURI,
179                                                                String JavaDoc name)
180                                                                throws DOMException JavaDoc;
181
182     /**
183      * Creates a new notation declaration.
184      * @param namespaceURI The namespace URI of the notation being declared.
185      * @param name The name of the notation. The format of the name could be
186      * an NCName as defined by XML Namespaces or a Name as defined by XML
187      * 1.0; it's ASModel-dependent.
188      * @param systemId The system identifier for the notation declaration.
189      * @param publicId The public identifier for the notation declaration.
190      * @return A new <code>ASNotationDeclaration</code> object with
191      * <code>notationName</code> attribute set to <code>name</code> and
192      * <code>publicId</code> and <code>systemId</code> set to the
193      * corresponding fields.
194      * @exception DOMException
195      * INVALID_CHARACTER_ERR: Raised if the specified name contains an
196      * illegal character.
197      */

198     public ASNotationDeclaration createASNotationDeclaration(String JavaDoc namespaceURI,
199                                                              String JavaDoc name,
200                                                              String JavaDoc systemId,
201                                                              String JavaDoc publicId)
202                                                              throws DOMException JavaDoc;
203
204     /**
205      * Creates an ASEntityDeclaration.
206      * @param name The name of the entity being declared.
207      * @return A new <code>ASEntityDeclaration</code> object with
208      * <code>entityName</code> attribute set to name.
209      * @exception DOMException
210      * INVALID_CHARACTER_ERR: Raised if the specified name contains an
211      * illegal character.
212      */

213     public ASEntityDeclaration createASEntityDeclaration(String JavaDoc name)
214                                                          throws DOMException JavaDoc;
215
216     /**
217      * Creates an object which describes part of an
218      * <code>ASElementDeclaration</code>'s content model.
219      * @param minOccurs The minimum occurrence for the subModels of this
220      * <code>ASContentModel</code>.
221      * @param maxOccurs The maximum occurrence for the subModels of this
222      * <code>ASContentModel</code>.
223      * @param operator operator of type <code>AS_CHOICE</code>,
224      * <code>AS_SEQUENCE</code>, <code>AS_ALL</code> or
225      * <code>AS_NONE</code>.
226      * @return A new <code>ASContentModel</code> object.
227      * @exception DOMASException
228      * A DOMASException, e.g., <code>minOccurs &gt; maxOccurs</code>.
229      */

230     public ASContentModel createASContentModel(int minOccurs,
231                                                int maxOccurs,
232                                                short operator)
233                                                throws DOMASException;
234
235 }
236
Popular Tags