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:
056: package com.sun.xml.internal.org.jvnet.fastinfoset;
057:
058: import java.util.Map;
059:
060: /**
061: * A general interface for parsers of fast infoset documents.
062: *
063: * <p>
064: * This interface contains common methods that are not specific to any
065: * API associated with the parsing of fast infoset documents.
066: *
067: * @author Paul.Sandoz@Sun.Com
068: */
069: public interface FastInfosetParser {
070: /**
071: * The property name to be used for getting and setting the string
072: * interning property of a parser.
073: *
074: */
075: public static final String STRING_INTERNING_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/string-interning";
076:
077: /**
078: * The property name to be used for getting and setting the buffer size
079: * of a parser.
080: */
081: public static final String BUFFER_SIZE_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/buffer-size";
082:
083: /**
084: * The property name to be used for getting and setting the
085: * Map containing encoding algorithms.
086: *
087: */
088: public static final String REGISTERED_ENCODING_ALGORITHMS_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/registered-encoding-algorithms";
089:
090: /**
091: * The property name to be used for getting and setting the
092: * Map containing external vocabularies.
093: *
094: */
095: public static final String EXTERNAL_VOCABULARIES_PROPERTY = "http://jvnet.org/fastinfoset/parser/properties/external-vocabularies";
096:
097: /**
098: * Set the string interning property.
099: *
100: * <p>If the string interning property is set to true then
101: * <code>String</code> objects instantiated for [namespace name], [prefix]
102: * and [local name] infoset properties will be interned using the method
103: * {@link String#intern()}.
104: *
105: * @param stringInterning The string interning property.
106: */
107: public void setStringInterning(boolean stringInterning);
108:
109: /**
110: * Return the string interning property.
111: *
112: * @return The string interning property.
113: */
114: public boolean getStringInterning();
115:
116: /**
117: * Set the buffer size.
118: *
119: * <p>The size of the buffer for parsing is set using this
120: * method. Requests for sizes smaller then the current size will be ignored.
121: * Otherwise the buffer will be resized when the next parse is performed.<p>
122: *
123: * @param bufferSize The requested buffer size.
124: */
125: public void setBufferSize(int bufferSize);
126:
127: /**
128: * Get the buffer size.
129: *
130: * @return The buffer size.
131: */
132: public int getBufferSize();
133:
134: /**
135: * Sets the set of registered encoding algorithms.
136: *
137: * @param algorithms The set of registered algorithms.
138: */
139: public void setRegisteredEncodingAlgorithms(Map algorithms);
140:
141: /**
142: * Gets the set of registered encoding algorithms.
143: *
144: * @return The set of registered algorithms.
145: */
146: public Map getRegisteredEncodingAlgorithms();
147:
148: /**
149: * Set the map of referenced external vocabularies.
150: * <p>
151: * The map (but not the keys and values) be cloned.
152: *
153: * @param referencedVocabualries the map of URI to vocabulary.
154: */
155: public void setExternalVocabularies(Map referencedVocabualries);
156:
157: /**
158: * Get the map of referenced external vocabularies.
159: *
160: * @return the map of URI to vocabulary.
161: * @deprecated
162: * The map returned will not be the same instance and contain
163: * the same entries as the map set by {@link #setExternalVocabularies}
164: * method.
165: */
166: public Map getExternalVocabularies();
167:
168: }
|