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: * Represents an abstract PSVI item for an element or an attribute
022: * information item.
023: */
024: public interface ItemPSVI {
025: /**
026: * Validity value indicating that validation has either not been performed
027: * or that a strict assessment of validity could not be performed.
028: */
029: public static final short VALIDITY_NOTKNOWN = 0;
030: /**
031: * Validity value indicating that validation has been strictly assessed
032: * and the item in question is invalid according to the rules of schema
033: * validation.
034: */
035: public static final short VALIDITY_INVALID = 1;
036: /**
037: * Validation status indicating that schema validation has been performed
038: * and the item in question is valid according to the rules of schema
039: * validation.
040: */
041: public static final short VALIDITY_VALID = 2;
042: /**
043: * Validation status indicating that schema validation has been performed
044: * and the item in question has specifically been skipped.
045: */
046: public static final short VALIDATION_NONE = 0;
047: /**
048: * Validation status indicating that schema validation has been performed
049: * on the item in question under the rules of lax validation.
050: */
051: public static final short VALIDATION_PARTIAL = 1;
052: /**
053: * Validation status indicating that full schema validation has been
054: * performed on the item.
055: */
056: public static final short VALIDATION_FULL = 2;
057:
058: /**
059: * The nearest ancestor element information item with a
060: * <code>[schema information]</code> property (or this element item
061: * itself if it has such a property). For more information refer to
062: * element validation context and attribute validation context .
063: */
064: public String getValidationContext();
065:
066: /**
067: * <code>[validity]</code>: determines the validity of the schema item
068: * with respect to the validation being attempted. The value will be one
069: * of the constants: <code>VALIDITY_NOTKNOWN</code>,
070: * <code>VALIDITY_INVALID</code> or <code>VALIDITY_VALID</code>.
071: */
072: public short getValidity();
073:
074: /**
075: * <code>[validation attempted]</code>: determines the extent to which
076: * the schema item has been validated. The value will be one of the
077: * constants: <code>VALIDATION_NONE</code>,
078: * <code>VALIDATION_PARTIAL</code> or <code>VALIDATION_FULL</code>.
079: */
080: public short getValidationAttempted();
081:
082: /**
083: * <code>[schema error code]</code>: a list of error codes generated from
084: * the validation attempt or an empty <code>StringList</code> if no
085: * errors occurred during the validation attempt.
086: */
087: public StringList getErrorCodes();
088:
089: /**
090: * <code>[schema normalized value]</code>: the normalized value of this
091: * item after validation.
092: */
093: public String getSchemaNormalizedValue();
094:
095: /**
096: * <code>[schema normalized value]</code>: Binding specific actual value
097: * or <code>null</code> if the value is in error.
098: * @exception XSException
099: * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
100: * method.
101: */
102: public Object getActualNormalizedValue() throws XSException;
103:
104: /**
105: * The actual value built-in datatype, e.g.
106: * <code>STRING_DT, SHORT_DT</code>. If the type definition of this
107: * value is a list type definition, this method returns
108: * <code>LIST_DT</code>. If the type definition of this value is a list
109: * type definition whose item type is a union type definition, this
110: * method returns <code>LISTOFUNION_DT</code>. To query the actual value
111: * of the list or list of union type definitions use
112: * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
113: * is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>
114: * .
115: * @exception XSException
116: * NOT_SUPPORTED_ERR: Raised if the implementation does not support this
117: * method.
118: */
119: public short getActualNormalizedValueType() 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> <simpleType name="listtype"> <list
127: * itemType="positiveInteger"/> </simpleType> <element
128: * name="list" type="listtype"/> ... <list>1 2 3</list> </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> <simpleType
139: * name='union_type' memberTypes="integer string"/> <simpleType
140: * name='listOfUnion'> <list itemType='union_type'/>
141: * </simpleType> <element name="list" type="listOfUnion"/>
142: * ... <list>1 2 foo</list> </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() throws XSException;
153:
154: /**
155: * <code>[type definition]</code>: an item isomorphic to the type
156: * definition used to validate the schema item.
157: */
158: public XSTypeDefinition getTypeDefinition();
159:
160: /**
161: * <code>[member type definition]</code>: if and only if that type
162: * definition is a simple type definition with {variety} union, or a
163: * complex type definition whose {content type} is a simple type
164: * definition with {variety} union, then an item isomorphic to that
165: * member of the union's {member type definitions} which actually
166: * validated the schema item's normalized value.
167: */
168: public XSSimpleTypeDefinition getMemberTypeDefinition();
169:
170: /**
171: * <code>[schema default]</code>: the canonical lexical representation of
172: * the declaration's {value constraint} value. For more information
173: * refer to element schema default and attribute schema default.
174: */
175: public String getSchemaDefault();
176:
177: /**
178: * <code>[schema specified]</code>: if true, the value was specified in
179: * the schema. If false, the value comes from the infoset. For more
180: * information refer to element specified and attribute specified.
181: */
182: public boolean getIsSchemaSpecified();
183:
184: }
|