286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: WriterChain.java,v 1.1.4.1 2005/09/08 10:58:44 suresh_emailid Exp $
286N/A */
286N/Apackage com.sun.org.apache.xml.internal.serializer;
286N/A
286N/Aimport java.io.IOException;
286N/A
286N/A/**
286N/A * It is unfortunate that java.io.Writer is a class rather than an interface.
286N/A * The serializer has a number of classes that extend java.io.Writer
286N/A * and which send their ouput to a yet another wrapped Writer or OutputStream.
286N/A *
286N/A * The purpose of this interface is to force such classes to over-ride all of
286N/A * the important methods defined on the java.io.Writer class, namely these:
286N/A * <code>
286N/A * write(int val)
286N/A * write(char[] chars)
286N/A * write(char[] chars, int start, int count)
286N/A * write(String chars)
286N/A * write(String chars, int start, int count)
286N/A * flush()
286N/A * close()
286N/A * </code>
286N/A * In this manner nothing will accidentally go directly to
286N/A * the base class rather than to the wrapped Writer or OutputStream.
286N/A *
286N/A * The purpose of this class is to have a uniform way of chaining the output of one writer to
286N/A * the next writer in the chain. In addition there are methods to obtain the Writer or
286N/A * OutputStream that this object sends its output to.
286N/A *
286N/A * This interface is only for internal use withing the serializer.
286N/A * @xsl.usage internal
286N/A */
286N/Ainterface WriterChain
286N/A{
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void write(int val) throws IOException;
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void write(char[] chars) throws IOException;
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void write(char[] chars, int start, int count) throws IOException;
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void write(String chars) throws IOException;
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void write(String chars, int start, int count) throws IOException;
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void flush() throws IOException;
286N/A /** This method forces us to over-ride the method defined in java.io.Writer */
286N/A public void close() throws IOException;
286N/A
286N/A /**
286N/A * If this method returns null, getOutputStream() must return non-null.
286N/A * Get the writer that this writer sends its output to.
286N/A *
286N/A * It is possible that the Writer returned by this method does not
286N/A * implement the WriterChain interface.
286N/A */
286N/A public java.io.Writer getWriter();
286N/A
286N/A /**
286N/A * If this method returns null, getWriter() must return non-null.
286N/A * Get the OutputStream that this writer sends its output to.
286N/A */
286N/A public java.io.OutputStream getOutputStream();
286N/A}