001: /*
002: * Copyright (c) 2001 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE.
010: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011: */
012:
013: package org.apache.xerces.dom3.as;
014:
015: import org.w3c.dom.DOMException;
016:
017: /**
018: * @deprecated
019: * To begin with, an abstract schema is a generic structure that could
020: * contain both internal and external subsets. An <code>ASModel</code> is an
021: * abstract object that could map to a DTD , an XML Schema , a database
022: * schema, etc. An <code>ASModel</code> could represent either an internal
023: * or an external subset; hence an abstract schema could be composed of an
024: * <code>ASModel</code> representing the internal subset and an
025: * <code>ASModel</code> representing the external subset. Note that the
026: * <code>ASModel</code> representing the external subset could consult the
027: * <code>ASModel</code> representing the internal subset. Furthermore, the
028: * <code>ASModel</code> representing the internal subset could be set to
029: * null by the <code>setInternalAS</code> method as a mechanism for
030: * "removal". In addition, only one <code>ASModel</code> representing the
031: * external subset can be specified as "active" and it is possible that none
032: * are "active". Finally, the <code>ASModel</code> contains the factory
033: * methods needed to create a various types of ASObjects like
034: * <code>ASElementDeclaration</code>, <code>ASAttributeDeclaration</code>,
035: * etc.
036: * <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
037: and Save Specification</a>.
038: */
039: public interface ASModel extends ASObject {
040: /**
041: * <code>true</code> if this <code>ASModel</code> defines the document
042: * structure in terms of namespaces and local names ; <code>false</code>
043: * if the document structure is defined only in terms of
044: * <code>QNames</code>.
045: */
046: public boolean getIsNamespaceAware();
047:
048: /**
049: * 0 if used internally, 1 if used externally, 2 if not all. An exception
050: * will be raised if it is incompatibly shared or in use as an internal
051: * subset.
052: */
053: public short getUsageLocation();
054:
055: /**
056: * The URI reference.
057: */
058: public String getAsLocation();
059:
060: /**
061: * The URI reference.
062: */
063: public void setAsLocation(String asLocation);
064:
065: /**
066: * The hint to locating an ASModel.
067: */
068: public String getAsHint();
069:
070: /**
071: * The hint to locating an ASModel.
072: */
073: public void setAsHint(String asHint);
074:
075: /**
076: * Instead of returning an all-in-one <code>ASObject</code> with
077: * <code>ASModel</code> methods, have discernible top-level/"global"
078: * element declarations. If one attempts to add, set, or remove a node
079: * type other than the intended one, a hierarchy exception (or
080: * equivalent is thrown).
081: */
082: public ASNamedObjectMap getElementDeclarations();
083:
084: /**
085: * Instead of returning an all-in-one <code>ASObject</code> with
086: * <code>ASModel</code> methods, have discernible top-level/"global"
087: * attribute declarations. If one attempts to add, set, or remove a node
088: * type other than the intended one, a hierarchy exception (or
089: * equivalent is thrown).
090: */
091: public ASNamedObjectMap getAttributeDeclarations();
092:
093: /**
094: * Instead of returning an all-in-one <code>ASObject</code> with
095: * <code>ASModel</code> methods, have discernible top-level/"global"
096: * notation declarations. If one attempts to add, set, or remove a node
097: * type other than the intended one, a hierarchy exception (or
098: * equivalent is thrown).
099: */
100: public ASNamedObjectMap getNotationDeclarations();
101:
102: /**
103: * Instead of returning an all-in-one <code>ASObject</code> with
104: * <code>ASModel</code> methods, have discernible top-level/"global"
105: * entity declarations. If one attempts to add, set, or remove a node
106: * type other than the intended one, a hierarchy exception (or
107: * equivalent is thrown).
108: */
109: public ASNamedObjectMap getEntityDeclarations();
110:
111: /**
112: * Instead of returning an all-in-one <code>ASObject</code> with
113: * <code>ASModel</code> methods, have discernible top-level/"global
114: * content model declarations. If one attempts to add, set, or remove a
115: * node type other than the intended one, a hierarchy exception (or
116: * equivalent is thrown).
117: */
118: public ASNamedObjectMap getContentModelDeclarations();
119:
120: /**
121: * This method will allow the nesting or "importation" of ASModels.
122: * @param abstractSchema ASModel to be set. Subsequent calls will nest
123: * the ASModels within the specified <code>ownerASModel</code>.
124: */
125: public void addASModel(ASModel abstractSchema);
126:
127: /**
128: * To retrieve a list of nested ASModels without reference to names.
129: * @return A list of ASModels.
130: */
131: public ASObjectList getASModels();
132:
133: /**
134: * Removes only the specified <code>ASModel</code> from the list of
135: * <code>ASModel</code>s.
136: * @param as AS to be removed.
137: */
138: public void removeAS(ASModel as);
139:
140: /**
141: * Determines if an <code>ASModel</code> itself is valid, i.e., confirming
142: * that it's well-formed and valid per its own formal grammar.
143: * @return <code>true</code> if the <code>ASModel</code> is valid,
144: * <code>false</code> otherwise.
145: */
146: public boolean validate();
147:
148: /**
149: * Creates an element declaration for the element type specified.
150: * @param namespaceURI The <code>namespace URI</code> of the element type
151: * being declared.
152: * @param name The name of the element. The format of the name could be
153: * an NCName as defined by XML Namespaces or a Name as defined by XML
154: * 1.0; it's ASModel-dependent.
155: * @return A new <code>ASElementDeclaration</code> object with
156: * <code>name</code> attribute set to <code>tagname</code> and
157: * <code>namespaceURI</code> set to <code>systemId</code>. Other
158: * attributes of the element declaration are set through
159: * <code>ASElementDeclaration</code> interface methods.
160: * @exception DOMException
161: * INVALID_CHARACTER_ERR: Raised if the specified name contains an
162: * illegal character.
163: */
164: public ASElementDeclaration createASElementDeclaration(
165: String namespaceURI, String name) throws DOMException;
166:
167: /**
168: * Creates an attribute declaration.
169: * @param namespaceURI The namespace URI of the attribute being declared.
170: * @param name The name of the attribute. The format of the name could be
171: * an NCName as defined by XML Namespaces or a Name as defined by XML
172: * 1.0; it's ASModel-dependent.
173: * @return A new <code>ASAttributeDeclaration</code> object with
174: * appropriate attributes set by input parameters.
175: * @exception DOMException
176: * INVALID_CHARACTER_ERR: Raised if the input <code>name</code>
177: * parameter contains an illegal character.
178: */
179: public ASAttributeDeclaration createASAttributeDeclaration(
180: String namespaceURI, String name) throws DOMException;
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(
199: String namespaceURI, String name, String systemId,
200: String publicId) throws DOMException;
201:
202: /**
203: * Creates an ASEntityDeclaration.
204: * @param name The name of the entity being declared.
205: * @return A new <code>ASEntityDeclaration</code> object with
206: * <code>entityName</code> attribute set to name.
207: * @exception DOMException
208: * INVALID_CHARACTER_ERR: Raised if the specified name contains an
209: * illegal character.
210: */
211: public ASEntityDeclaration createASEntityDeclaration(String name)
212: throws DOMException;
213:
214: /**
215: * Creates an object which describes part of an
216: * <code>ASElementDeclaration</code>'s content model.
217: * @param minOccurs The minimum occurrence for the subModels of this
218: * <code>ASContentModel</code>.
219: * @param maxOccurs The maximum occurrence for the subModels of this
220: * <code>ASContentModel</code>.
221: * @param operator operator of type <code>AS_CHOICE</code>,
222: * <code>AS_SEQUENCE</code>, <code>AS_ALL</code> or
223: * <code>AS_NONE</code>.
224: * @return A new <code>ASContentModel</code> object.
225: * @exception DOMASException
226: * A DOMASException, e.g., <code>minOccurs > maxOccurs</code>.
227: */
228: public ASContentModel createASContentModel(int minOccurs,
229: int maxOccurs, short operator) throws DOMASException;
230:
231: }
|