2
* The Apache Software License, Version 1.1
5
* Copyright (c) 2003 The Apache Software Foundation. All rights
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
12
* 1. Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
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
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.
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.
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.
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
48
* ====================================================================
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/>.
58
package org.apache.xerces.xs;
61
* Represents an abstract PSVI item for an element or an attribute
64
public interface ItemPSVI {
66
* Validity value indicating that validation has either not been performed
67
* or that a strict assessment of validity could not be performed.
69
public static final short VALIDITY_NOTKNOWN = 0;
71
* Validity value indicating that validation has been strictly assessed
72
* and the item in question is invalid according to the rules of schema
75
public static final short VALIDITY_INVALID = 1;
77
* Validation status indicating that schema validation has been performed
78
* and the item in question is valid according to the rules of schema
81
public static final short VALIDITY_VALID = 2;
83
* Validation status indicating that schema validation has been performed
84
* and the item in question has specifically been skipped.
86
public static final short VALIDATION_NONE = 0;
88
* Validation status indicating that schema validation has been performed
89
* on the item in question under the rules of lax validation.
91
public static final short VALIDATION_PARTIAL = 1;
93
* Validation status indicating that full schema validation has been
94
* performed on the item.
96
public static final short VALIDATION_FULL = 2;
98
* The nearest ancestor element information item with a
99
* <code>[schema information]</code> property (or this element item
100
* itself if it has such a property). For more information refer to
101
* element validation context and attribute validation context .
103
public String getValidationContext();
106
* <code>[validity]</code>: determines the validity of the schema item
107
* with respect to the validation being attempted. The value will be one
108
* of the constants: <code>VALIDITY_NOTKNOWN</code>,
109
* <code>VALIDITY_INVALID</code> or <code>VALIDITY_VALID</code>.
111
public short getValidity();
114
* <code>[validation attempted]</code>: determines the extent to which
115
* the schema item has been validated. The value will be one of the
116
* constants: <code>VALIDATION_NONE</code>,
117
* <code>VALIDATION_PARTIAL</code> or <code>VALIDATION_FULL</code>.
119
public short getValidationAttempted();
122
* <code>[schema error code]</code>: a list of error codes generated from
123
* the validation attempt or an empty <code>StringList</code> if no
124
* errors occurred during the validation attempt.
126
public StringList getErrorCodes();
129
* <code>[schema normalized value]</code>: the normalized value of this
130
* item after validation.
132
public String getSchemaNormalizedValue();
135
* <code>[schema normalized value]</code>: Binding specific actual value
136
* or <code>null</code> if the value is in error.
137
* @exception XSException
138
* NOT_SUPPORTED_ERR: Raised if the implementation does not support this
141
public Object getActualNormalizedValue()
145
* The actual value built-in datatype, e.g.
146
* <code>STRING_DT, SHORT_DT</code>. If the type definition of this
147
* value is a list type definition, this method returns
148
* <code>LIST_DT</code>. If the type definition of this value is a list
149
* type definition whose item type is a union type definition, this
150
* method returns <code>LISTOFUNION_DT</code>. To query the actual value
151
* of the list or list of union type definitions use
152
* <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
153
* is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
155
* @exception XSException
156
* NOT_SUPPORTED_ERR: Raised if the implementation does not support this
159
public short getActualNormalizedValueType()
163
* In the case the actual value represents a list, i.e. the
164
* <code>actualNormalizedValueType</code> is <code>LIST_DT</code>, the
165
* returned array consists of one type kind which represents the itemType
167
* <pre> <simpleType name="listtype"> <list
168
* itemType="positiveInteger"/> </simpleType> <element
169
* name="list" type="listtype"/> ... <list>1 2 3</list> </pre>
171
* The <code>schemaNormalizedValue</code> value is "1 2 3", the
172
* <code>actualNormalizedValueType</code> value is <code>LIST_DT</code>,
173
* and the <code>itemValueTypes</code> is an array of size 1 with the
174
* value <code>POSITIVEINTEGER_DT</code>.
175
* <br> If the actual value represents a list type definition whose item
176
* type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
177
* for each actual value in the list the array contains the
178
* corresponding memberType kind. For example:
179
* <pre> <simpleType
180
* name='union_type' memberTypes="integer string"/> <simpleType
181
* name='listOfUnion'> <list itemType='union_type'/>
182
* </simpleType> <element name="list" type="listOfUnion"/>
183
* ... <list>1 2 foo</list> </pre>
185
* <code>schemaNormalizedValue</code> value is "1 2 foo", the
186
* <code>actualNormalizedValueType</code> is <code>LISTOFUNION_DT</code>
187
* , and the <code>itemValueTypes</code> is an array of size 3 with the
188
* following values: <code>INTEGER_DT, INTEGER_DT, STRING_DT</code>.
189
* @exception XSException
190
* NOT_SUPPORTED_ERR: Raised if the implementation does not support this
193
public ShortList getItemValueTypes()
197
* <code>[type definition]</code>: an item isomorphic to the type
198
* definition used to validate the schema item.
200
public XSTypeDefinition getTypeDefinition();
203
* <code>[member type definition]</code>: if and only if that type
204
* definition is a simple type definition with {variety} union, or a
205
* complex type definition whose {content type} is a simple type
206
* definition with {variety} union, then an item isomorphic to that
207
* member of the union's {member type definitions} which actually
208
* validated the schema item's normalized value.
210
public XSSimpleTypeDefinition getMemberTypeDefinition();
213
* <code>[schema default]</code>: the canonical lexical representation of
214
* the declaration's {value constraint} value. For more information
215
* refer to element schema default and attribute schema default.
217
public String getSchemaDefault();
220
* <code>[schema specified]</code>: if true, the value was specified in
221
* the schema. If false, the value comes from the infoset. For more
222
* information refer to element specified and attribute specified.
224
public boolean getIsSchemaSpecified();