author | mkos |
Sun, 30 Dec 2012 00:00:00 +0100 | |
changeset 22678 | ac1ea46be942 |
parent 12009 | 4abb694f273a |
permissions | -rw-r--r-- |
12009 | 1 |
/* |
22678
ac1ea46be942
8029237: Update copyright year to match last edit in jaxws repository for 2012
mkos
parents:
12009
diff
changeset
|
2 |
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. |
12009 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
* |
|
25 |
* THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC. |
|
26 |
*/ |
|
27 |
||
28 |
package com.sun.xml.internal.org.jvnet.fastinfoset.sax; |
|
29 |
||
30 |
import org.xml.sax.SAXException; |
|
31 |
||
32 |
/** |
|
33 |
* SAX2 extention handler to receive notification of encoding algorithm data. |
|
34 |
* |
|
35 |
* <p>This is an optional extension handler for SAX2. XML readers are not |
|
36 |
* required to recognize this handler, and it is not part of core-only |
|
37 |
* SAX2 distributions.</p> |
|
38 |
* |
|
39 |
* <p>This interface may be used with with a Fast Infoset |
|
40 |
* SAX parser to receive notification of encoding algorithm data specified |
|
41 |
* in ITU-T Rec. X.891 | ISO/IEC 24824-1 (Fast Infoset) clause 10 and for |
|
42 |
* application defined encoding algorithms specified as part of the |
|
43 |
* initial vocabulary of a fast infoset document.<p> |
|
44 |
* |
|
45 |
* <p>To set the EncodingAlgorithmContentHandler for an XML reader, use the |
|
46 |
* {@link org.xml.sax.XMLReader#setProperty setProperty} method |
|
47 |
* with the property name |
|
48 |
* <code>URI TO BE DEFINED</code> |
|
49 |
* and an object implementing this interface (or null) as the value. |
|
50 |
* If the reader does not report primitive data types, it will throw a |
|
51 |
* {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}</p> |
|
52 |
* |
|
53 |
* <p>To set the EncodingAlgorithmContentHandler for an Fast Infoset reader, use |
|
54 |
* {@link com.sun.xml.internal.org.jvnet.fastinfoset.sax.FastInfosetReader#setEncodingAlgorithmContentHandler |
|
55 |
* setEncodingAlgorithmContentHandler} method.<p> |
|
56 |
* |
|
57 |
* @see com.sun.xml.internal.org.jvnet.fastinfoset.sax.PrimitiveTypeContentHandler |
|
58 |
* @see com.sun.xml.internal.org.jvnet.fastinfoset.sax.FastInfosetReader |
|
59 |
* @see org.xml.sax.XMLReader |
|
60 |
*/ |
|
61 |
public interface EncodingAlgorithmContentHandler { |
|
62 |
/** |
|
63 |
* Receive notification of encoding algorithm data as an array |
|
64 |
* of byte. |
|
65 |
* |
|
66 |
* <p>The application must not attempt to read from the array |
|
67 |
* outside of the specified range.</p> |
|
68 |
* |
|
69 |
* <p>Such notifications will occur for a Fast Infoset SAX parser |
|
70 |
* when processing encoding algorithm data.<p> |
|
71 |
* |
|
72 |
* <p>The Parser will call the method of this interface to report each |
|
73 |
* encoding algorithm data. Parsers MUST return all contiguous |
|
74 |
* characters in a single chunk</p> |
|
75 |
* |
|
76 |
* <p>Parsers may return all contiguous bytes in a single chunk, or |
|
77 |
* they may split it into several chunks providing that the length of |
|
78 |
* each chunk is of the required length to successfully apply the |
|
79 |
* encoding algorithm to the chunk.</p> |
|
80 |
* |
|
81 |
* @param URI the URI of the encoding algorithm |
|
82 |
* @param algorithm the encoding algorithm index |
|
83 |
* @param b the array of byte |
|
84 |
* @param start the start position in the array |
|
85 |
* @param length the number of byte to read from the array |
|
86 |
* @throws org.xml.sax.SAXException any SAX exception, possibly |
|
87 |
* wrapping another exception |
|
88 |
* @see com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes |
|
89 |
*/ |
|
90 |
public void octets(String URI, int algorithm, byte[] b, int start, int length) throws SAXException; |
|
91 |
||
92 |
/** |
|
93 |
* Receive notification of encoding algorithm data as an object. |
|
94 |
* |
|
95 |
* <p>Such notifications will occur for a Fast Infoset SAX parser |
|
96 |
* when processing encoding algorithm data that is converted from an |
|
97 |
* array of byte to an object more suitable for processing.<p> |
|
98 |
* |
|
99 |
* @param URI the URI of the encoding algorithm |
|
100 |
* @param algorithm the encoding algorithm index |
|
101 |
* @param o the encoding algorithm object |
|
102 |
* @throws org.xml.sax.SAXException any SAX exception, possibly |
|
103 |
* wrapping another exception |
|
104 |
* @see com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes |
|
105 |
*/ |
|
106 |
public void object(String URI, int algorithm, Object o) throws SAXException; |
|
107 |
} |