KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xs > XSElementDeclaration


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.xs;
18
19 /**
20  * The interface represents the Element Declaration schema component.
21  */

22 public interface XSElementDeclaration extends XSTerm {
23     /**
24      * [type definition]: either a simple type definition or a complex type
25      * definition.
26      */

27     public XSTypeDefinition getTypeDefinition();
28
29     /**
30      * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
31      * <code>SCOPE_ABSENT</code>. If the scope is local, then the
32      * <code>enclosingCTDefinition</code> is present.
33      */

34     public short getScope();
35
36     /**
37      * The complex type definition for locally scoped declarations (see
38      * <code>scope</code>), otherwise <code>null</code> if no such
39      * definition exists.
40      */

41     public XSComplexTypeDefinition getEnclosingCTDefinition();
42
43     /**
44      * [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
45      */

46     public short getConstraintType();
47
48     /**
49      * [Value constraint]: the constraint value with respect to the [type
50      * definition], otherwise <code>null</code>.
51      */

52     public String JavaDoc getConstraintValue();
53
54     /**
55      * Value Constraint: Binding specific actual constraint value or
56      * <code>null</code> if the value is in error or there is no value
57      * constraint.
58      * @exception XSException
59      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
60      * method.
61      */

62     public Object JavaDoc getActualVC()
63                                             throws XSException;
64
65     /**
66      * The actual constraint value built-in datatype, e.g.
67      * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
68      * value is a list type definition, this method returns
69      * <code>LIST_DT</code>. If the type definition of this value is a list
70      * type definition whose item type is a union type definition, this
71      * method returns <code>LISTOFUNION_DT</code>. To query the actual
72      * constraint value of the list or list of union type definitions use
73      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
74      * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
75      * .
76      * @exception XSException
77      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
78      * method.
79      */

80     public short getActualVCType()
81                                             throws XSException;
82
83     /**
84      * In the case the actual constraint value represents a list, i.e. the
85      * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
86      * array consists of one type kind which represents the itemType. If the
87      * actual constraint value represents a list type definition whose item
88      * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
89      * for each actual constraint value in the list the array contains the
90      * corresponding memberType kind. For examples, see
91      * <code>ItemPSVI.itemValueTypes</code>.
92      * @exception XSException
93      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
94      * method.
95      */

96     public ShortList getItemValueTypes()
97                                             throws XSException;
98
99     /**
100      * If nillable is true, then an element may also be valid if it carries
101      * the namespace qualified attribute with local name <code>nil</code>
102      * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code>
103      * and value <code>true</code> (xsi:nil) even if it has no text or
104      * element content despite a <code>content type</code> which would
105      * otherwise require content.
106      */

107     public boolean getNillable();
108
109     /**
110      * identity-constraint definitions: a set of constraint definitions if it
111      * exists, otherwise an empty <code>XSNamedMap</code>.
112      */

113     public XSNamedMap getIdentityConstraints();
114
115     /**
116      * [substitution group affiliation]: a top-level element definition if it
117      * exists, otherwise <code>null</code>.
118      */

119     public XSElementDeclaration getSubstitutionGroupAffiliation();
120
121     /**
122      * Convenience method that checks if <code>exclusion</code> is a
123      * substitution group exclusion for this element declaration.
124      * @param exclusion
125      * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or
126      * <code>DERIVATION_NONE</code>. Represents final set for the element.
127      * @return True if <code>exclusion</code> is a part of the substitution
128      * group exclusion subset.
129      */

130     public boolean isSubstitutionGroupExclusion(short exclusion);
131
132     /**
133      * [substitution group exclusions]: the returned value is a bit
134      * combination of the subset of {
135      * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or
136      * <code>DERIVATION_NONE</code>.
137      */

138     public short getSubstitutionGroupExclusions();
139
140     /**
141      * Convenience method that checks if <code>disallowed</code> is a
142      * disallowed substitution for this element declaration.
143      * @param disallowed {
144      * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
145      * } or <code>DERIVATION_NONE</code>. Represents a block set for the
146      * element.
147      * @return True if <code>disallowed</code> is a part of the substitution
148      * group exclusion subset.
149      */

150     public boolean isDisallowedSubstitution(short disallowed);
151
152     /**
153      * [disallowed substitutions]: the returned value is a bit combination of
154      * the subset of {
155      * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
156      * } corresponding to substitutions disallowed by this
157      * <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>.
158      */

159     public short getDisallowedSubstitutions();
160
161     /**
162      * {abstract} A boolean.
163      */

164     public boolean getAbstract();
165
166     /**
167      * An annotation if it exists, otherwise <code>null</code>.
168      */

169     public XSAnnotation getAnnotation();
170
171 }
172
Popular Tags