001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.xerces.xs;
019:
020: /**
021: * The interface represents the Element Declaration schema component.
022: */
023: public interface XSElementDeclaration extends XSTerm {
024: /**
025: * [type definition]: either a simple type definition or a complex type
026: * definition.
027: */
028: public XSTypeDefinition getTypeDefinition();
029:
030: /**
031: * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or
032: * <code>SCOPE_ABSENT</code>. If the scope is local, then the
033: * <code>enclosingCTDefinition</code> is present.
034: */
035: public short getScope();
036:
037: /**
038: * The complex type definition for locally scoped declarations (see
039: * <code>scope</code>), otherwise <code>null</code> if no such
040: * definition exists.
041: */
042: public XSComplexTypeDefinition getEnclosingCTDefinition();
043:
044: /**
045: * [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
046: */
047: public short getConstraintType();
048:
049: /**
050: * [Value constraint]: the constraint value with respect to the [type
051: * definition], otherwise <code>null</code>.
052: */
053: public String getConstraintValue();
054:
055: /**
056: * Value Constraint: Binding specific actual constraint value or
057: * <code>null</code> if the value is in error or there is no value
058: * constraint.
059: * @exception XSException
060: * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
061: * method.
062: */
063: public Object getActualVC() throws XSException;
064:
065: /**
066: * The actual constraint value built-in datatype, e.g.
067: * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
068: * value is a list type definition, this method returns
069: * <code>LIST_DT</code>. If the type definition of this value is a list
070: * type definition whose item type is a union type definition, this
071: * method returns <code>LISTOFUNION_DT</code>. To query the actual
072: * constraint value of the list or list of union type definitions use
073: * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
074: * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
075: * .
076: * @exception XSException
077: * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
078: * method.
079: */
080: public short getActualVCType() throws XSException;
081:
082: /**
083: * In the case the actual constraint value represents a list, i.e. the
084: * <code>actualValueType</code> is <code>LIST_DT</code>, the returned
085: * array consists of one type kind which represents the itemType. If the
086: * actual constraint value represents a list type definition whose item
087: * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
088: * for each actual constraint value in the list the array contains the
089: * corresponding memberType kind. For examples, see
090: * <code>ItemPSVI.itemValueTypes</code>.
091: * @exception XSException
092: * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
093: * method.
094: */
095: public ShortList getItemValueTypes() throws XSException;
096:
097: /**
098: * If nillable is true, then an element may also be valid if it carries
099: * the namespace qualified attribute with local name <code>nil</code>
100: * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code>
101: * and value <code>true</code> (xsi:nil) even if it has no text or
102: * element content despite a <code>content type</code> which would
103: * otherwise require content.
104: */
105: public boolean getNillable();
106:
107: /**
108: * identity-constraint definitions: a set of constraint definitions if it
109: * exists, otherwise an empty <code>XSNamedMap</code>.
110: */
111: public XSNamedMap getIdentityConstraints();
112:
113: /**
114: * [substitution group affiliation]: a top-level element definition if it
115: * exists, otherwise <code>null</code>.
116: */
117: public XSElementDeclaration getSubstitutionGroupAffiliation();
118:
119: /**
120: * Convenience method that checks if <code>exclusion</code> is a
121: * substitution group exclusion for this element declaration.
122: * @param exclusion
123: * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or
124: * <code>DERIVATION_NONE</code>. Represents final set for the element.
125: * @return True if <code>exclusion</code> is a part of the substitution
126: * group exclusion subset.
127: */
128: public boolean isSubstitutionGroupExclusion(short exclusion);
129:
130: /**
131: * [substitution group exclusions]: the returned value is a bit
132: * combination of the subset of {
133: * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or
134: * <code>DERIVATION_NONE</code>.
135: */
136: public short getSubstitutionGroupExclusions();
137:
138: /**
139: * Convenience method that checks if <code>disallowed</code> is a
140: * disallowed substitution for this element declaration.
141: * @param disallowed {
142: * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
143: * } or <code>DERIVATION_NONE</code>. Represents a block set for the
144: * element.
145: * @return True if <code>disallowed</code> is a part of the substitution
146: * group exclusion subset.
147: */
148: public boolean isDisallowedSubstitution(short disallowed);
149:
150: /**
151: * [disallowed substitutions]: the returned value is a bit combination of
152: * the subset of {
153: * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
154: * } corresponding to substitutions disallowed by this
155: * <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>.
156: */
157: public short getDisallowedSubstitutions();
158:
159: /**
160: * {abstract} A boolean.
161: */
162: public boolean getAbstract();
163:
164: /**
165: * An annotation if it exists, otherwise <code>null</code>. If not null
166: * then the first [annotation] from the sequence of annotations.
167: */
168: public XSAnnotation getAnnotation();
169:
170: /**
171: * A sequence of [annotations] or an empty <code>XSObjectList</code>.
172: */
173: public XSObjectList getAnnotations();
174: }
|