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: /**
016: * @deprecated
017: * The content model of a declared element.
018: * <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
019: and Save Specification</a>.
020: */
021: public interface ASContentModel extends ASObject {
022: /**
023: * Signifies unbounded upper limit. The MAX_VALUE value is
024: * <code>0xFFFFFFFF FFFFFFFF</code>. This needs to be better defined in
025: * the generated bindings.
026: */
027: public static final int AS_UNBOUNDED = Integer.MAX_VALUE;
028: // ASContentModelType
029: /**
030: * This constant value signifies a sequence operator. For example, in a
031: * DTD, this would be the '<code>,</code>' operator.
032: */
033: public static final short AS_SEQUENCE = 0;
034: /**
035: * This constant value signifies a choice operator. For example, in a DTD,
036: * this would be the '<code>|</code>' operator.
037: */
038: public static final short AS_CHOICE = 1;
039: /**
040: * All of the above.
041: */
042: public static final short AS_ALL = 2;
043: /**
044: * None of the above, i.e., neither a choice nor sequence operator.
045: */
046: public static final short AS_NONE = 3;
047:
048: /**
049: * One of <code>AS_CHOICE</code>, <code>AS_SEQUENCE</code>,
050: * <code>AS_ALL</code> or <code>AS_NONE</code>. The operator is applied
051: * to all the components(ASObjects) in the <code>subModels</code>. For
052: * example, if the list operator is <code>AS_CHOICE</code> and the
053: * components in subModels are a, b and c then the abstract schema for
054: * the element being declared is <code>(a|b|c)</code>.
055: */
056: public short getListOperator();
057:
058: /**
059: * One of <code>AS_CHOICE</code>, <code>AS_SEQUENCE</code>,
060: * <code>AS_ALL</code> or <code>AS_NONE</code>. The operator is applied
061: * to all the components(ASObjects) in the <code>subModels</code>. For
062: * example, if the list operator is <code>AS_CHOICE</code> and the
063: * components in subModels are a, b and c then the abstract schema for
064: * the element being declared is <code>(a|b|c)</code>.
065: */
066: public void setListOperator(short listOperator);
067:
068: /**
069: * min occurrence for this content particle. Its value may be 0 or a
070: * positive integer.
071: */
072: public int getMinOccurs();
073:
074: /**
075: * min occurrence for this content particle. Its value may be 0 or a
076: * positive integer.
077: */
078: public void setMinOccurs(int minOccurs);
079:
080: /**
081: * maximum occurrence for this content particle. Its value may be
082: * <code>0</code>, a positive integer, or <code>AS_UNBOUNDED</code> to
083: * indicate that no upper limit has been set.
084: */
085: public int getMaxOccurs();
086:
087: /**
088: * maximum occurrence for this content particle. Its value may be
089: * <code>0</code>, a positive integer, or <code>AS_UNBOUNDED</code> to
090: * indicate that no upper limit has been set.
091: */
092: public void setMaxOccurs(int maxOccurs);
093:
094: /**
095: * Pointers to <code>ASObject</code>s such as
096: * <code> ASElementDeclaration</code>s and further
097: * <code>ASContentModel</code>s.
098: */
099: public ASObjectList getSubModels();
100:
101: /**
102: * Pointers to <code>ASObject</code>s such as
103: * <code> ASElementDeclaration</code>s and further
104: * <code>ASContentModel</code>s.
105: */
106: public void setSubModels(ASObjectList subModels);
107:
108: /**
109: * Removes the <code>ASObject</code> in the submodel. Nodes that already
110: * exist in the list are moved as needed.
111: * @param oldNode The node to be removed.
112: */
113: public void removesubModel(ASObject oldNode);
114:
115: /**
116: * Inserts a new node in the submodel. Nodes that already exist in the
117: * list are moved as needed.
118: * @param newNode The new node to be inserted.
119: * @exception DOMASException
120: * <code>DUPLICATE_NAME_ERR</code>: Raised if a element declaration
121: * already exists with the same name within an <code>AS_CHOICE</code>
122: * operator.
123: */
124: public void insertsubModel(ASObject newNode) throws DOMASException;
125:
126: /**
127: * Appends a new node to the end of the list representing the
128: * <code>subModels</code>.
129: * @param newNode The new node to be appended.
130: * @return the length of the <code>subModels</code>.
131: * @exception DOMASException
132: * <code>DUPLICATE_NAME_ERR</code>: Raised if a element declaration
133: * already exists with the same name within an <code>AS_CHOICE</code>
134: * operator.
135: * <br> <code>TYPE_ERR</code>: Raised if type is neither an
136: * <code>ASContentModel</code> nor an <code>ASElementDeclaration</code>
137: * .
138: */
139: public int appendsubModel(ASObject newNode) throws DOMASException;
140:
141: }
|