001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: *
025: * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
026: */
027:
028: /*
029: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
030: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
031: *
032: * This code is free software; you can redistribute it and/or modify it
033: * under the terms of the GNU General Public License version 2 only, as
034: * published by the Free Software Foundation. Sun designates this
035: * particular file as subject to the "Classpath" exception as provided
036: * by Sun in the LICENSE file that accompanied this code.
037: *
038: * This code is distributed in the hope that it will be useful, but WITHOUT
039: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
040: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
041: * version 2 for more details (a copy is included in the LICENSE file that
042: * accompanied this code).
043: *
044: * You should have received a copy of the GNU General Public License version
045: * 2 along with this work; if not, write to the Free Software Foundation,
046: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
047: *
048: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
049: * CA 95054 USA or visit www.sun.com if you need additional information or
050: * have any questions.
051: *
052: * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
053: *
054: */
055: package com.sun.xml.internal.org.jvnet.fastinfoset;
056:
057: import java.io.OutputStream;
058: import java.util.Map;
059:
060: /**
061: * A general interface for serializers of fast infoset documents.
062: *
063: * <p>
064: * This interface contains common methods that are not specific to any
065: * API associated with the serialization of XML Infoset to fast infoset
066: * documents.
067: *
068: * @author Paul.Sandoz@Sun.Com
069: */
070: public interface FastInfosetSerializer {
071: /**
072: * The feature to ignore comments.
073: * <p>
074: * The default value is false. If true a serializer shall ignore comments
075: * and shall not serialize them.
076: */
077: public static final String IGNORE_COMMENTS_FEATURE = "http://jvnet.org/fastinfoset/serializer/feature/ignore/comments";
078:
079: /**
080: * The feature to ignore processing instructions.
081: * <p>
082: * The default value is false. If true a serializer shall ignore processing
083: * instructions and shall not serialize them.
084: */
085: public static final String IGNORE_PROCESSING_INSTRUCTIONS_FEATURE = "http://jvnet.org/fastinfoset/serializer/feature/ignore/processingInstructions";
086:
087: /**
088: * The feature to ignore text content that consists completely of white
089: * space characters.
090: * <p>
091: * The default value is false. If true a serializer shall ignore text
092: * content that consists completely of white space characters.
093: */
094: public static final String IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE = "http://jvnet.org/fastinfoset/serializer/feature/ignore/whiteSpaceTextContent";
095:
096: /**
097: * The property name to be used for getting and setting the buffer size
098: * of a parser.
099: */
100: public static final String BUFFER_SIZE_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/buffer-size";
101:
102: /**
103: * The property name to be used for getting and setting the
104: * Map containing encoding algorithms.
105: *
106: */
107: public static final String REGISTERED_ENCODING_ALGORITHMS_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/registered-encoding-algorithms";
108:
109: /**
110: * The property name to be used for getting and setting the
111: * Map containing external vocabularies.
112: *
113: */
114: public static final String EXTERNAL_VOCABULARIES_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/external-vocabularies";
115:
116: /**
117: * The default value for the limit on the size of character content chunks
118: * that will be indexed.
119: */
120: public final static int CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT = 7;
121:
122: /**
123: * The default value for the limit on the size of attribute values
124: * that will be indexed.
125: */
126: public final static int ATTRIBUTE_VALUE_SIZE_CONSTRAINT = 7;
127:
128: /**
129: * The character encoding scheme string for UTF-8.
130: */
131: public static final String UTF_8 = "UTF-8";
132:
133: /**
134: * The character encoding scheme string for UTF-16BE.
135: */
136: public static final String UTF_16BE = "UTF-16BE";
137:
138: /**
139: * Set the {@link #IGNORE_COMMENTS_FEATURE}.
140: * @param ignoreComments true if the feature shall be ignored.
141: */
142: public void setIgnoreComments(boolean ignoreComments);
143:
144: /**
145: * Get the {@link #IGNORE_COMMENTS_FEATURE}.
146: * @return true if the feature is ignored, false otherwise.
147: */
148: public boolean getIgnoreComments();
149:
150: /**
151: * Set the {@link #IGNORE_PROCESSING_INSTRUCTIONS_FEATURE}.
152: * @param ignoreProcesingInstructions true if the feature shall be ignored.
153: */
154: public void setIgnoreProcesingInstructions(
155: boolean ignoreProcesingInstructions);
156:
157: /**
158: * Get the {@link #IGNORE_PROCESSING_INSTRUCTIONS_FEATURE}.
159: * @return true if the feature is ignored, false otherwise.
160: */
161: public boolean getIgnoreProcesingInstructions();
162:
163: /**
164: * Set the {@link #IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE}.
165: * @param ignoreWhiteSpaceTextContent true if the feature shall be ignored.
166: */
167: public void setIgnoreWhiteSpaceTextContent(
168: boolean ignoreWhiteSpaceTextContent);
169:
170: /**
171: * Get the {@link #IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE}.
172: * @return true if the feature is ignored, false otherwise.
173: */
174: public boolean getIgnoreWhiteSpaceTextContent();
175:
176: /**
177: * Sets the character encoding scheme.
178: *
179: * The character encoding can be either UTF-8 or UTF-16BE for the
180: * the encoding of chunks of CIIs, the [normalized value]
181: * property of attribute information items, comment information
182: * items and processing instruction information items.
183: *
184: * @param characterEncodingScheme The set of registered algorithms.
185: */
186: public void setCharacterEncodingScheme(
187: String characterEncodingScheme);
188:
189: /**
190: * Gets the character encoding scheme.
191: *
192: * @return The character encoding scheme.
193: */
194: public String getCharacterEncodingScheme();
195:
196: /**
197: * Sets the set of registered encoding algorithms.
198: *
199: * @param algorithms The set of registered algorithms.
200: */
201: public void setRegisteredEncodingAlgorithms(Map algorithms);
202:
203: /**
204: * Gets the set of registered encoding algorithms.
205: *
206: * @return The set of registered algorithms.
207: */
208: public Map getRegisteredEncodingAlgorithms();
209:
210: /**
211: * Sets the limit on the size of character content chunks
212: * that will be indexed.
213: *
214: * @param size The character content chunk size limit. Any chunk less
215: * that a length of size limit will be indexed.
216: */
217: public void setCharacterContentChunkSizeLimit(int size);
218:
219: /**
220: * Gets the limit on the size of character content chunks
221: * that will be indexed.
222: *
223: * @return The character content chunk size limit.
224: */
225: public int getCharacterContentChunkSizeLimit();
226:
227: /**
228: * Sets the limit on the size of attribute values
229: * that will be indexed.
230: *
231: * @param size The attribute value size limit. Any value less
232: * that a length of size limit will be indexed.
233: */
234: public void setAttributeValueSizeLimit(int size);
235:
236: /**
237: * Gets the limit on the size of attribute values
238: * that will be indexed.
239: *
240: * @return The attribute value size limit.
241: */
242: public int getAttributeValueSizeLimit();
243:
244: /**
245: * Set the external vocabulary that shall be used when serializing.
246: *
247: * @param v the vocabulary.
248: */
249: public void setExternalVocabulary(ExternalVocabulary v);
250:
251: /**
252: * Reset the serializer for reuse serializing another XML infoset.
253: */
254: public void reset();
255:
256: /**
257: * Set the OutputStream to serialize the XML infoset to a
258: * fast infoset document.
259: *
260: * @param s the OutputStream where the fast infoset document is written to.
261: */
262: public void setOutputStream(OutputStream s);
263: }
|