KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Represents an abstract PSVI item for an element or an attribute
62  * information item.
63  */

64 public interface ItemPSVI {
65     /**
66      * Validity value indicating that validation has either not been performed
67      * or that a strict assessment of validity could not be performed.
68      */

69     public static final short VALIDITY_NOTKNOWN = 0;
70     /**
71      * Validity value indicating that validation has been strictly assessed
72      * and the item in question is invalid according to the rules of schema
73      * validation.
74      */

75     public static final short VALIDITY_INVALID = 1;
76     /**
77      * Validation status indicating that schema validation has been performed
78      * and the item in question is valid according to the rules of schema
79      * validation.
80      */

81     public static final short VALIDITY_VALID = 2;
82     /**
83      * Validation status indicating that schema validation has been performed
84      * and the item in question has specifically been skipped.
85      */

86     public static final short VALIDATION_NONE = 0;
87     /**
88      * Validation status indicating that schema validation has been performed
89      * on the item in question under the rules of lax validation.
90      */

91     public static final short VALIDATION_PARTIAL = 1;
92     /**
93      * Validation status indicating that full schema validation has been
94      * performed on the item.
95      */

96     public static final short VALIDATION_FULL = 2;
97     /**
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 .
102      */

103     public String JavaDoc getValidationContext();
104
105     /**
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>.
110      */

111     public short getValidity();
112
113     /**
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>.
118      */

119     public short getValidationAttempted();
120
121     /**
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.
125      */

126     public StringList getErrorCodes();
127
128     /**
129      * <code>[schema normalized value]</code>: the normalized value of this
130      * item after validation.
131      */

132     public String JavaDoc getSchemaNormalizedValue();
133
134     /**
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
139      * method.
140      */

141     public Object JavaDoc getActualNormalizedValue()
142                                    throws XSException;
143
144     /**
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>
154      * .
155      * @exception XSException
156      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
157      * method.
158      */

159     public short getActualNormalizedValueType()
160                                    throws XSException;
161
162     /**
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
166      * . For example:
167      * <pre> &lt;simpleType name="listtype"&gt; &lt;list
168      * itemType="positiveInteger"/&gt; &lt;/simpleType&gt; &lt;element
169      * name="list" type="listtype"/&gt; ... &lt;list&gt;1 2 3&lt;/list&gt; </pre>
170      *
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> &lt;simpleType
180      * name='union_type' memberTypes="integer string"/&gt; &lt;simpleType
181      * name='listOfUnion'&gt; &lt;list itemType='union_type'/&gt;
182      * &lt;/simpleType&gt; &lt;element name="list" type="listOfUnion"/&gt;
183      * ... &lt;list&gt;1 2 foo&lt;/list&gt; </pre>
184      * The
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
191      * method.
192      */

193     public ShortList getItemValueTypes()
194                                    throws XSException;
195
196     /**
197      * <code>[type definition]</code>: an item isomorphic to the type
198      * definition used to validate the schema item.
199      */

200     public XSTypeDefinition getTypeDefinition();
201
202     /**
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.
209      */

210     public XSSimpleTypeDefinition getMemberTypeDefinition();
211
212     /**
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.
216      */

217     public String JavaDoc getSchemaDefault();
218
219     /**
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.
223      */

224     public boolean getIsSchemaSpecified();
225
226 }
227
Popular Tags