View Javadoc
1   /*
2    * reserved comment block
3    * DO NOT REMOVE OR ALTER!
4    */
5   /*
6    * Copyright 2003,2004 The Apache Software Foundation.
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   *      http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   */
20  
21  package com.sun.org.apache.xerces.internal.xs;
22  
23  /**
24   * The interface represents the Element Declaration schema component.
25   */
26  public interface XSElementDeclaration extends XSTerm {
27      /**
28       * [type definition]: either a simple type definition or a complex type
29       * definition.
30       */
31      public XSTypeDefinition getTypeDefinition();
32  
33      /**
34       * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
35       * <code>SCOPE_ABSENT</code>. If the scope is local, then the
36       * <code>enclosingCTDefinition</code> is present.
37       */
38      public short getScope();
39  
40      /**
41       * The complex type definition for locally scoped declarations (see
42       * <code>scope</code>), otherwise <code>null</code> if no such
43       * definition exists.
44       */
45      public XSComplexTypeDefinition getEnclosingCTDefinition();
46  
47      /**
48       * [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
49       */
50      public short getConstraintType();
51  
52      /**
53       * [Value constraint]: the constraint value with respect to the [type
54       * definition], otherwise <code>null</code>.
55       */
56      public String getConstraintValue();
57  
58      /**
59       * Value Constraint: Binding specific actual constraint value or
60       * <code>null</code> if the value is in error or there is no value
61       * constraint.
62       * @exception XSException
63       *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
64       *   method.
65       */
66      public Object getActualVC()
67                                              throws XSException;
68  
69      /**
70       * The actual constraint value built-in datatype, e.g.
71       * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
72       * value is a list type definition, this method returns
73       * <code>LIST_DT</code>. If the type definition of this value is a list
74       * type definition whose item type is a union type definition, this
75       * method returns <code>LISTOFUNION_DT</code>. To query the actual
76       * constraint value of the list or list of union type definitions use
77       * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
78       *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
79       * .
80       * @exception XSException
81       *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
82       *   method.
83       */
84      public short getActualVCType()
85                                              throws XSException;
86  
87      /**
88       * In the case the actual constraint value represents a list, i.e. the
89       * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
90       * array consists of one type kind which represents the itemType. If the
91       * actual constraint value represents a list type definition whose item
92       * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
93       * for each actual constraint value in the list the array contains the
94       * corresponding memberType kind. For examples, see
95       * <code>ItemPSVI.itemValueTypes</code>.
96       * @exception XSException
97       *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this
98       *   method.
99       */
100     public ShortList getItemValueTypes()
101                                             throws XSException;
102 
103     /**
104      *  If nillable is true, then an element may also be valid if it carries
105      * the namespace qualified attribute with local name <code>nil</code>
106      * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code>;
107      * and value <code>true</code> (xsi:nil) even if it has no text or
108      * element content despite a <code>content type</code> which would
109      * otherwise require content.
110      */
111     public boolean getNillable();
112 
113     /**
114      * identity-constraint definitions: a set of constraint definitions if it
115      * exists, otherwise an empty <code>XSNamedMap</code>.
116      */
117     public XSNamedMap getIdentityConstraints();
118 
119     /**
120      * [substitution group affiliation]: a top-level element definition if it
121      * exists, otherwise <code>null</code>.
122      */
123     public XSElementDeclaration getSubstitutionGroupAffiliation();
124 
125     /**
126      * Convenience method that checks if <code>exclusion</code> is a
127      * substitution group exclusion for this element declaration.
128      * @param exclusion
129      *   <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or
130      *   <code>DERIVATION_NONE</code>. Represents final set for the element.
131      * @return True if <code>exclusion</code> is a part of the substitution
132      *   group exclusion subset.
133      */
134     public boolean isSubstitutionGroupExclusion(short exclusion);
135 
136     /**
137      *  [substitution group exclusions]: the returned value is a bit
138      * combination of the subset of {
139      * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or
140      * <code>DERIVATION_NONE</code>.
141      */
142     public short getSubstitutionGroupExclusions();
143 
144     /**
145      * Convenience method that checks if <code>disallowed</code> is a
146      * disallowed substitution for this element declaration.
147      * @param disallowed {
148      *   <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
149      *   } or <code>DERIVATION_NONE</code>. Represents a block set for the
150      *   element.
151      * @return True if <code>disallowed</code> is a part of the substitution
152      *   group exclusion subset.
153      */
154     public boolean isDisallowedSubstitution(short disallowed);
155 
156     /**
157      *  [disallowed substitutions]: the returned value is a bit combination of
158      * the subset of {
159      * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
160      * } corresponding to substitutions disallowed by this
161      * <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>.
162      */
163     public short getDisallowedSubstitutions();
164 
165     /**
166      * {abstract} A boolean.
167      */
168     public boolean getAbstract();
169 
170     /**
171      * An annotation if it exists, otherwise <code>null</code>. If not null
172      * then the first [annotation] from the sequence of annotations.
173      */
174     public XSAnnotation getAnnotation();
175 
176     /**
177      * A sequence of [annotations] or an empty <code>XSObjectList</code>.
178      */
179     public XSObjectList getAnnotations();
180 }