KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jvnet > fastinfoset > sax > EncodingAlgorithmContentHandler


1 /*
2  * Fast Infoset ver. 0.1 software ("Software")
3  *
4  * Copyright, 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
5  *
6  * Software is licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License. You may
8  * obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations.
16  *
17  * Sun supports and benefits from the global community of open source
18  * developers, and thanks the community for its important contributions and
19  * open standards-based technology, which Sun has adopted into many of its
20  * products.
21  *
22  * Please note that portions of Software may be provided with notices and
23  * open source licenses from such communities and third parties that govern the
24  * use of those portions, and any licenses granted hereunder do not alter any
25  * rights and obligations you may have under such open source licenses,
26  * however, the disclaimer of warranty and limitation of liability provisions
27  * in this License will apply to all Software in this distribution.
28  *
29  * You acknowledge that the Software is not designed, licensed or intended
30  * for use in the design, construction, operation or maintenance of any nuclear
31  * facility.
32  *
33  * Apache License
34  * Version 2.0, January 2004
35  * http://www.apache.org/licenses/
36  *
37  */

38
39 package org.jvnet.fastinfoset.sax;
40
41 import org.xml.sax.SAXException JavaDoc;
42
43 /**
44  * SAX2 extention handler to receive notification of encoding algorithm data.
45  *
46  * <p>This is an optional extension handler for SAX2. XML readers are not
47  * required to recognize this handler, and it is not part of core-only
48  * SAX2 distributions.</p>
49  *
50  * <p>This interface may be used with with a Fast Infoset
51  * SAX parser to receive notification of encoding algorithm data specified
52  * in ITU-T Rec. X.891 | ISO/IEC 24824-1 (Fast Infoset) clause 10 and for
53  * application defined encoding algorithms specified as part of the
54  * initial vocabulary of a fast infoset document.<p>
55  *
56  * <p>To set the EncodingAlgorithmContentHandler for an XML reader, use the
57  * {@link org.xml.sax.XMLReader#setProperty setProperty} method
58  * with the property name
59  * <code>URI TO BE DEFINED</code>
60  * and an object implementing this interface (or null) as the value.
61  * If the reader does not report primitive data types, it will throw a
62  * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}</p>
63  *
64  * <p>To set the EncodingAlgorithmContentHandler for an Fast Infoset reader, use
65  * {@link org.jvnet.fastinfoset.sax.FastInfosetReader#setEncodingAlgorithmContentHandler
66  * setEncodingAlgorithmContentHandler} method.<p>
67  *
68  * @version 0.1
69  * @see org.jvnet.fastinfoset.sax.PrimitiveTypeContentHandler
70  * @see org.jvnet.fastinfoset.sax.FastInfosetReader
71  * @see org.xml.sax.XMLReader
72  */

73 public interface EncodingAlgorithmContentHandler {
74     /**
75      * Receive notification of encoding algorithm data as an array
76      * of byte.
77      *
78      * <p>The application must not attempt to read from the array
79      * outside of the specified range.</p>
80      *
81      * <p>Such notifications will occur for a Fast Infoset SAX parser
82      * when processing encoding algorithm data.<p>
83      *
84      * <p>The Parser will call the method of this interface to report each
85      * encoding algorithm data. Parsers MUST return all contiguous
86      * characters in a single chunk</p>
87      *
88      * <p>Parsers may return all contiguous bytes in a single chunk, or
89      * they may split it into several chunks providing that the length of
90      * each chunk is of the required length to successfully apply the
91      * encoding algorithm to the chunk.</p>
92      *
93      * @param URI the URI of the encoding algorithm
94      * @param algorithm the encoding algorithm index
95      * @param b the array of byte
96      * @param start the start position in the array
97      * @param length the number of byte to read from the array
98      * @throws org.xml.sax.SAXException any SAX exception, possibly
99      * wrapping another exception
100      * @see org.jvnet.fastinfoset.EncodingAlgorithmIndexes
101      */

102     public void octets(String JavaDoc URI, int algorithm, byte[] b, int start, int length) throws SAXException JavaDoc;
103
104     /**
105      * Receive notification of encoding algorithm data as an object.
106      *
107      * <p>Such notifications will occur for a Fast Infoset SAX parser
108      * when processing encoding algorithm data that is converted from an
109      * array of byte to an object more suitable for processing.<p>
110      *
111      * @param URI the URI of the encoding algorithm
112      * @param algorithm the encoding algorithm index
113      * @param o the encoding algorithm object
114      * @throws org.xml.sax.SAXException any SAX exception, possibly
115      * wrapping another exception
116      * @see org.jvnet.fastinfoset.EncodingAlgorithmIndexes
117      */

118     public void object(String JavaDoc URI, int algorithm, Object JavaDoc o) throws SAXException JavaDoc;
119 }
120
Popular Tags