KickJava   Java API By Example, From Geeks To Geeks.

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


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

23 public interface ItemPSVI {
24     /**
25      * Validity value indicating that validation has either not been performed
26      * or that a strict assessment of validity could not be performed.
27      */

28     public static final short VALIDITY_NOTKNOWN = 0;
29     /**
30      * Validity value indicating that validation has been strictly assessed
31      * and the item in question is invalid according to the rules of schema
32      * validation.
33      */

34     public static final short VALIDITY_INVALID = 1;
35     /**
36      * Validation status indicating that schema validation has been performed
37      * and the item in question is valid according to the rules of schema
38      * validation.
39      */

40     public static final short VALIDITY_VALID = 2;
41     /**
42      * Validation status indicating that schema validation has been performed
43      * and the item in question has specifically been skipped.
44      */

45     public static final short VALIDATION_NONE = 0;
46     /**
47      * Validation status indicating that schema validation has been performed
48      * on the item in question under the rules of lax validation.
49      */

50     public static final short VALIDATION_PARTIAL = 1;
51     /**
52      * Validation status indicating that full schema validation has been
53      * performed on the item.
54      */

55     public static final short VALIDATION_FULL = 2;
56     /**
57      * The nearest ancestor element information item with a
58      * <code>[schema information]</code> property (or this element item
59      * itself if it has such a property). For more information refer to
60      * element validation context and attribute validation context .
61      */

62     public String JavaDoc getValidationContext();
63
64     /**
65      * <code>[validity]</code>: determines the validity of the schema item
66      * with respect to the validation being attempted. The value will be one
67      * of the constants: <code>VALIDITY_NOTKNOWN</code>,
68      * <code>VALIDITY_INVALID</code> or <code>VALIDITY_VALID</code>.
69      */

70     public short getValidity();
71
72     /**
73      * <code>[validation attempted]</code>: determines the extent to which
74      * the schema item has been validated. The value will be one of the
75      * constants: <code>VALIDATION_NONE</code>,
76      * <code>VALIDATION_PARTIAL</code> or <code>VALIDATION_FULL</code>.
77      */

78     public short getValidationAttempted();
79
80     /**
81      * <code>[schema error code]</code>: a list of error codes generated from
82      * the validation attempt or an empty <code>StringList</code> if no
83      * errors occurred during the validation attempt.
84      */

85     public StringList getErrorCodes();
86
87     /**
88      * <code>[schema normalized value]</code>: the normalized value of this
89      * item after validation.
90      */

91     public String JavaDoc getSchemaNormalizedValue();
92
93     /**
94      * <code>[schema normalized value]</code>: Binding specific actual value
95      * or <code>null</code> if the value is in error.
96      * @exception XSException
97      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
98      * method.
99      */

100     public Object JavaDoc getActualNormalizedValue()
101                                    throws XSException;
102
103     /**
104      * The actual value built-in datatype, e.g.
105      * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
106      * value is a list type definition, this method returns
107      * <code>LIST_DT</code>. If the type definition of this value is a list
108      * type definition whose item type is a union type definition, this
109      * method returns <code>LISTOFUNION_DT</code>. To query the actual value
110      * of the list or list of union type definitions use
111      * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
112      * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
113      * .
114      * @exception XSException
115      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
116      * method.
117      */

118     public short getActualNormalizedValueType()
119                                    throws XSException;
120
121     /**
122      * In the case the actual value represents a list, i.e. the
123      * <code>actualNormalizedValueType</code> is <code>LIST_DT</code>, the
124      * returned array consists of one type kind which represents the itemType
125      * . For example:
126      * <pre> &lt;simpleType name="listtype"&gt; &lt;list
127      * itemType="positiveInteger"/&gt; &lt;/simpleType&gt; &lt;element
128      * name="list" type="listtype"/&gt; ... &lt;list&gt;1 2 3&lt;/list&gt; </pre>
129      *
130      * The <code>schemaNormalizedValue</code> value is "1 2 3", the
131      * <code>actualNormalizedValueType</code> value is <code>LIST_DT</code>,
132      * and the <code>itemValueTypes</code> is an array of size 1 with the
133      * value <code>POSITIVEINTEGER_DT</code>.
134      * <br> If the actual value represents a list type definition whose item
135      * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>,
136      * for each actual value in the list the array contains the
137      * corresponding memberType kind. For example:
138      * <pre> &lt;simpleType
139      * name='union_type' memberTypes="integer string"/&gt; &lt;simpleType
140      * name='listOfUnion'&gt; &lt;list itemType='union_type'/&gt;
141      * &lt;/simpleType&gt; &lt;element name="list" type="listOfUnion"/&gt;
142      * ... &lt;list&gt;1 2 foo&lt;/list&gt; </pre>
143      * The
144      * <code>schemaNormalizedValue</code> value is "1 2 foo", the
145      * <code>actualNormalizedValueType</code> is <code>LISTOFUNION_DT</code>
146      * , and the <code>itemValueTypes</code> is an array of size 3 with the
147      * following values: <code>INTEGER_DT, INTEGER_DT, STRING_DT</code>.
148      * @exception XSException
149      * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
150      * method.
151      */

152     public ShortList getItemValueTypes()
153                                    throws XSException;
154
155     /**
156      * <code>[type definition]</code>: an item isomorphic to the type
157      * definition used to validate the schema item.
158      */

159     public XSTypeDefinition getTypeDefinition();
160
161     /**
162      * <code>[member type definition]</code>: if and only if that type
163      * definition is a simple type definition with {variety} union, or a
164      * complex type definition whose {content type} is a simple type
165      * definition with {variety} union, then an item isomorphic to that
166      * member of the union's {member type definitions} which actually
167      * validated the schema item's normalized value.
168      */

169     public XSSimpleTypeDefinition getMemberTypeDefinition();
170
171     /**
172      * <code>[schema default]</code>: the canonical lexical representation of
173      * the declaration's {value constraint} value. For more information
174      * refer to element schema default and attribute schema default.
175      */

176     public String JavaDoc getSchemaDefault();
177
178     /**
179      * <code>[schema specified]</code>: if true, the value was specified in
180      * the schema. If false, the value comes from the infoset. For more
181      * information refer to element specified and attribute specified.
182      */

183     public boolean getIsSchemaSpecified();
184
185 }
186
Popular Tags