jaxp/src/com/sun/org/apache/xml/internal/serializer/WriterChain.java
author lana
Tue, 18 Mar 2014 17:49:48 -0700
changeset 23377 2af1ddf102a4
parent 12457 c348e06f0e82
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: WriterChain.java,v 1.1.4.1 2005/09/08 10:58:44 suresh_emailid Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
package com.sun.org.apache.xml.internal.serializer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import java.io.IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 * It is unfortunate that java.io.Writer is a class rather than an interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 * The serializer has a number of classes that extend java.io.Writer
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 * and which send their ouput to a yet another wrapped Writer or OutputStream.
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 * The purpose of this interface is to force such classes to over-ride all of
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * the important methods defined on the java.io.Writer class, namely these:
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * <code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * write(int val)
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * write(char[] chars)
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * write(char[] chars, int start, int count)
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * write(String chars)
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * write(String chars, int start, int count)
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * flush()
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * close()
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * </code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * In this manner nothing will accidentally go directly to
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * the base class rather than to the wrapped Writer or OutputStream.
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * The purpose of this class is to have a uniform way of chaining the output of one writer to
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * the next writer in the chain. In addition there are methods to obtain the Writer or
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * OutputStream that this object sends its output to.
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * This interface is only for internal use withing the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * @xsl.usage internal
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
interface WriterChain
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
    public void write(int val) throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
    public void write(char[] chars) throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
    public void write(char[] chars, int start, int count) throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
    public void write(String chars) throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
    public void write(String chars, int start, int count) throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
    public void flush() throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
    /** This method forces us to over-ride the method defined in java.io.Writer */
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    public void close() throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * If this method returns null, getOutputStream() must return non-null.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * Get the writer that this writer sends its output to.
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * It is possible that the Writer returned by this method does not
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     * implement the WriterChain interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
    public java.io.Writer getWriter();
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     * If this method returns null, getWriter() must return non-null.
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * Get the OutputStream that this writer sends its output to.
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
    public java.io.OutputStream getOutputStream();
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
}