KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > xs > XSElementDeclaration


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2003 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Xerces" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 2003, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package com.sun.org.apache.xerces.internal.xs;
59
60 /**
61  * The interface represents the Element Declaration schema component.
62  */

63 public interface XSElementDeclaration extends XSTerm {
64     /**
65      * [type definition]: either a simple type definition or a complex type
66      * definition.
67      */

68     public XSTypeDefinition getTypeDefinition();
69
70     /**
71      * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
72      * <code>SCOPE_ABSENT</code>. If the scope is local, then the
73      * <code>enclosingCTDefinition</code> is present.
74      */

75     public short getScope();
76
77     /**
78      * The complex type definition for locally scoped declarations (see
79      * <code>scope</code>), otherwise <code>null</code> if no such
80      * definition exists.
81      */

82     public XSComplexTypeDefinition getEnclosingCTDefinition();
83
84     /**
85      * [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
86      */

87     public short getConstraintType();
88
89     /**
90      * [Value constraint]: the constraint value with respect to the [type
91      * definition], otherwise <code>null</code>.
92      */

93     public String JavaDoc getConstraintValue();
94
95     /**
96      * Value Constraint: Binding specific actual constraint value or
97      * <code>null</code> if the value is in error or there is no value
98      * constraint.
99      * @exception XSException
100      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
101      * method.
102      */

103     public Object JavaDoc getActualVC()
104                                             throws XSException;
105
106     /**
107      * The actual constraint value built-in datatype, e.g.
108      * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
109      * value is a list type definition, this method returns
110      * <code>LIST_DT</code>. If the type definition of this value is a list
111      * type definition whose item type is a union type definition, this
112      * method returns <code>LISTOFUNION_DT</code>. To query the actual
113      * constraint value of the list or list of union type definitions use
114      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
115      * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
116      * .
117      * @exception XSException
118      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
119      * method.
120      */

121     public short getActualVCType()
122                                             throws XSException;
123
124     /**
125      * In the case the actual constraint value represents a list, i.e. the
126      * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
127      * array consists of one type kind which represents the itemType. If the
128      * actual constraint value represents a list type definition whose item
129      * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
130      * for each actual constraint value in the list the array contains the
131      * corresponding memberType kind. For examples, see
132      * <code>ItemPSVI.itemValueTypes</code>.
133      * @exception XSException
134      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
135      * method.
136      */

137     public ShortList getItemValueTypes()
138                                             throws XSException;
139
140     /**
141      * If nillable is true, then an element may also be valid if it carries
142      * the namespace qualified attribute with local name <code>nil</code>
143      * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code>
144      * and value <code>true</code> (xsi:nil) even if it has no text or
145      * element content despite a <code>content type</code> which would
146      * otherwise require content.
147      */

148     public boolean getNillable();
149
150     /**
151      * identity-constraint definitions: a set of constraint definitions if it
152      * exists, otherwise an empty <code>XSNamedMap</code>.
153      */

154     public XSNamedMap getIdentityConstraints();
155
156     /**
157      * [substitution group affiliation]: a top-level element definition if it
158      * exists, otherwise <code>null</code>.
159      */

160     public XSElementDeclaration getSubstitutionGroupAffiliation();
161
162     /**
163      * Convenience method that checks if <code>exclusion</code> is a
164      * substitution group exclusion for this element declaration.
165      * @param exclusion
166      * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or
167      * <code>DERIVATION_NONE</code>. Represents final set for the element.
168      * @return True if <code>exclusion</code> is a part of the substitution
169      * group exclusion subset.
170      */

171     public boolean isSubstitutionGroupExclusion(short exclusion);
172
173     /**
174      * [substitution group exclusions]: the returned value is a bit
175      * combination of the subset of {
176      * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or
177      * <code>DERIVATION_NONE</code>.
178      */

179     public short getSubstitutionGroupExclusions();
180
181     /**
182      * Convenience method that checks if <code>disallowed</code> is a
183      * disallowed substitution for this element declaration.
184      * @param disallowed {
185      * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
186      * } or <code>DERIVATION_NONE</code>. Represents a block set for the
187      * element.
188      * @return True if <code>disallowed</code> is a part of the substitution
189      * group exclusion subset.
190      */

191     public boolean isDisallowedSubstitution(short disallowed);
192
193     /**
194      * [disallowed substitutions]: the returned value is a bit combination of
195      * the subset of {
196      * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
197      * } corresponding to substitutions disallowed by this
198      * <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>.
199      */

200     public short getDisallowedSubstitutions();
201
202     /**
203      * {abstract} A boolean.
204      */

205     public boolean getAbstract();
206
207     /**
208      * An annotation if it exists, otherwise <code>null</code>.
209      */

210     public XSAnnotation getAnnotation();
211
212 }
213
Popular Tags