01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.xs;
19:
20: /**
21: * This interface provides access to the post schema validation infoset for an
22: * API that provides a streaming document infoset, such as SAX, XNI, and
23: * others.
24: * <p>For implementations that would like to provide access to the PSVI in a
25: * streaming model, a parser object should also implement the
26: * <code>PSVIProvider</code> interface. Within the scope of the methods
27: * handling the start and end of an element, applications may use the
28: * <code>PSVIProvider</code> to retrieve the PSVI related to the element and
29: * its attributes.
30: */
31: public interface PSVIProvider {
32: /**
33: * Provides the post schema validation item for the current element
34: * information item. The method must be called by an application while
35: * in the scope of the methods which report the start and end of an
36: * element. For example, for SAX the method must be called within the
37: * scope of the document handler's <code>startElement</code> or
38: * <code>endElement</code> call. If the method is called outside of the
39: * specified scope, the return value is undefined.
40: * @return The post schema validation infoset for the current element. If
41: * an element information item is valid, then in the
42: * post-schema-validation infoset the following properties must be
43: * available for the element information item: The following
44: * properties are available in the scope of the method that reports
45: * the start of an element: {element declaration}, {validation
46: * context}, {notation}. The {schema information} property is
47: * available for the validation root. The {error codes} property is
48: * available if any errors occured during validation. The following
49: * properties are available in the scope of the method that reports
50: * the end of an element: {nil}, {schema specified}, {normalized
51: * value},{ member type definition}, {validity}, {validation attempted}
52: * . If the declaration has a value constraint, the property {schema
53: * default} is available. The {error codes} property is available if
54: * any errors occured during validation. Note: some processors may
55: * choose to provide all the PSVI properties in the scope of the
56: * method that reports the end of an element.
57: */
58: public ElementPSVI getElementPSVI();
59:
60: /**
61: * Provides <code>AttributePSVI</code> given the index of an attribute
62: * information item in the current element's attribute list. The method
63: * must be called by an application while in the scope of the methods
64: * which report the start and end of an element at a point where the
65: * attribute list is available. For example, for SAX the method must be
66: * called while in the scope of the document handler's
67: * <code>startElement</code> call. If the method is called outside of
68: * the specified scope, the return value is undefined.
69: * @param index The attribute index.
70: * @return The post schema validation properties of the attribute.
71: */
72: public AttributePSVI getAttributePSVI(int index);
73:
74: /**
75: * Provides <code>AttributePSVI</code> given the namespace name and the
76: * local name of an attribute information item in the current element's
77: * attribute list. The method must be called by an application while in
78: * the scope of the methods which report the start and end of an element
79: * at a point where the attribute list is available. For example, for
80: * SAX the method must be called while in the scope of the document
81: * handler's <code>startElement</code> call. If the method is called
82: * outside of the specified scope, the return value is undefined.
83: * @param uri The namespace name of an attribute.
84: * @param localname The local name of an attribute.
85: * @return The post schema validation properties of the attribute.
86: */
87: public AttributePSVI getAttributePSVIByName(String uri,
88: String localname);
89:
90: }
|