Thu, 12 Oct 2017 19:44:07 +0800
merge
1 /*
2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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 */
28 package com.sun.xml.internal.org.jvnet.fastinfoset;
30 import java.util.Map;
32 /**
33 * A general interface for parsers of fast infoset documents.
34 *
35 * <p>
36 * This interface contains common methods that are not specific to any
37 * API associated with the parsing of fast infoset documents.
38 *
39 * @author Paul.Sandoz@Sun.Com
40 */
41 public interface FastInfosetParser {
42 /**
43 * The property name to be used for getting and setting the string
44 * interning property of a parser.
45 *
46 */
47 public static final String STRING_INTERNING_PROPERTY =
48 "http://jvnet.org/fastinfoset/parser/properties/string-interning";
50 /**
51 * The property name to be used for getting and setting the buffer size
52 * of a parser.
53 */
54 public static final String BUFFER_SIZE_PROPERTY =
55 "http://jvnet.org/fastinfoset/parser/properties/buffer-size";
57 /**
58 * The property name to be used for getting and setting the
59 * Map containing encoding algorithms.
60 *
61 */
62 public static final String REGISTERED_ENCODING_ALGORITHMS_PROPERTY =
63 "http://jvnet.org/fastinfoset/parser/properties/registered-encoding-algorithms";
65 /**
66 * The property name to be used for getting and setting the
67 * Map containing external vocabularies.
68 *
69 */
70 public static final String EXTERNAL_VOCABULARIES_PROPERTY =
71 "http://jvnet.org/fastinfoset/parser/properties/external-vocabularies";
73 /**
74 * The property name to be used for getting and setting the
75 * flag, which will indicate whether underlying Parser's
76 * input stream should be really closed
77 */
78 public static final String FORCE_STREAM_CLOSE_PROPERTY =
79 "http://jvnet.org/fastinfoset/parser/properties/force-stream-close";
81 /**
82 * Set the string interning property.
83 *
84 * <p>If the string interning property is set to true then
85 * <code>String</code> objects instantiated for [namespace name], [prefix]
86 * and [local name] infoset properties will be interned using the method
87 * {@link String#intern()}.
88 *
89 * @param stringInterning The string interning property.
90 */
91 public void setStringInterning(boolean stringInterning);
93 /**
94 * Return the string interning property.
95 *
96 * @return The string interning property.
97 */
98 public boolean getStringInterning();
100 /**
101 * Set the buffer size.
102 *
103 * <p>The size of the buffer for parsing is set using this
104 * method. Requests for sizes smaller then the current size will be ignored.
105 * Otherwise the buffer will be resized when the next parse is performed.<p>
106 *
107 * @param bufferSize The requested buffer size.
108 */
109 public void setBufferSize(int bufferSize);
112 /**
113 * Get the buffer size.
114 *
115 * @return The buffer size.
116 */
117 public int getBufferSize();
120 /**
121 * Sets the set of registered encoding algorithms.
122 *
123 * @param algorithms The set of registered algorithms.
124 */
125 public void setRegisteredEncodingAlgorithms(Map algorithms);
127 /**
128 * Gets the set of registered encoding algorithms.
129 *
130 * @return The set of registered algorithms.
131 */
132 public Map getRegisteredEncodingAlgorithms();
134 /**
135 * Set the map of referenced external vocabularies.
136 * <p>
137 * The map (but not the keys and values) be cloned.
138 *
139 * @param referencedVocabualries the map of URI to vocabulary.
140 */
141 public void setExternalVocabularies(Map referencedVocabualries);
143 /**
144 * Get the map of referenced external vocabularies.
145 *
146 * @return the map of URI to vocabulary.
147 * @deprecated
148 * The map returned will not be the same instance and contain
149 * the same entries as the map set by {@link #setExternalVocabularies}
150 * method.
151 */
152 public Map getExternalVocabularies();
154 /**
155 * Set the parse fragments property.
156 *
157 * <p>If the parse fragments property is set to true then
158 * fragments of an XML infoset may be parsed.
159 *
160 * @param parseFragments The parse fragments property.
161 */
162 public void setParseFragments(boolean parseFragments);
164 /**
165 * Return the parse fragments property.
166 *
167 * @return The parse fragments property.
168 */
169 public boolean getParseFragments();
171 /**
172 * Set the force stream close property.
173 *
174 * <p>If the force stream property is set to true then
175 * Parser's underlying InputStream will be closed.
176 *
177 * @param needForceStreamClose The force stream close property.
178 */
179 public void setForceStreamClose(boolean needForceStreamClose);
181 /**
182 * Return the force stream close property.
183 *
184 * @return The force stream close property.
185 */
186 public boolean getForceStreamClose();
188 }