01: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.serialize;
07:
08: import java.io.IOException;
09: import java.io.UnsupportedEncodingException;
10:
11: /**
12: * <code>CachingSerializer</code> interface allows low-level character interaction with a serializer.
13: *
14: * @author Peter Kharchenko {@link <a href="mailto:pkharchenko@interactivebusiness.com"">pkharchenko@interactivebusiness.com"</a>}
15: */
16: public interface CachingSerializer {
17:
18: /**
19: * Commands serializer to start caching.
20: *
21: * @return <code>false</code> if the serializer is already caching.
22: */
23: public boolean startCaching() throws IOException;
24:
25: /**
26: * Commands serializer to stop caching.
27: *
28: * @return <code>false</code> if the serializer was NOT caching.
29: */
30: public boolean stopCaching() throws IOException;
31:
32: /**
33: * Asks serializer for an accumulated cache content.
34: *
35: * @return a <code>String</code> cache.
36: * @exception UnsupportedEncodingException if the OutputFormat specified unsupported encoding
37: */
38: public String getCache() throws UnsupportedEncodingException,
39: IOException;
40:
41: /**
42: * Allows one to print a <code>String</code> of characters directly to the output stream.
43: *
44: * @param text a <code>String</code> value
45: */
46: public void printRawCharacters(String text) throws IOException;
47:
48: /**
49: * Let the serializer know if the document has already
50: * been started.
51: *
52: * @param setting a <code>boolean</code> value
53: */
54: public void setDocumentStarted(boolean setting);
55:
56: /**
57: * Flushes all the buffers
58: *
59: * @exception IOException if an error occurs
60: */
61: public void flush() throws IOException;
62: }
|