jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
author joehw
Tue, 17 Apr 2012 11:17:59 -0700
changeset 12458 d601e4bba306
parent 12457 c348e06f0e82
child 25834 aba3efbf4ec5
permissions -rw-r--r--
7160380: Sync JDK8 with JAXP 1.4.5 Summary: bring JDK8 up to date to what we have in 7u4 Reviewed-by: lancea, mullan
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 2003-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: SerializationHandler.java,v 1.2.4.1 2005/09/15 08:15:22 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
import javax.xml.transform.Transformer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import org.xml.sax.ContentHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import org.xml.sax.ErrorHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import org.xml.sax.SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import org.xml.sax.ext.DeclHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * This interface is the one that a serializer implements. It is a group of
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * other interfaces, such as ExtendedContentHandler, ExtendedLexicalHandler etc.
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * In addition there are other methods, such as reset().
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * This class is public only because it is used in another package,
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * it is not a public API.
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * @xsl.usage internal
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
public interface SerializationHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
    extends
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
        ExtendedContentHandler,
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
        ExtendedLexicalHandler,
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
        XSLOutputAttributes,
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
        DeclHandler,
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
        org.xml.sax.DTDHandler,
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
        ErrorHandler,
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
        DOMSerializer,
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
        Serializer
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     * Set the SAX Content handler that the serializer sends its output to. This
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
     * method only applies to a ToSAXHandler, not to a ToStream serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
     * @see Serializer#asContentHandler()
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * @see ToSAXHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
    public void setContentHandler(ContentHandler ch);
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    public void close();
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * Notify that the serializer should take this DOM node as input to be
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * serialized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * @param node the DOM node to be serialized.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * @throws IOException
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
    public void serialize(Node node) throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * Turns special character escaping on/off.
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     * Note that characters will
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     * never, even if this option is set to 'true', be escaped within
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     * CDATA sections in output XML documents.
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * @param escape true if escaping is to be set on.
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
    public boolean setEscaping(boolean escape) throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     * Set the number of spaces to indent for each indentation level.
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     * @param spaces the number of spaces to indent for each indentation level.
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
    public void setIndentAmount(int spaces);
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     * Set the transformer associated with the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     * @param transformer the transformer associated with the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
    public void setTransformer(Transformer transformer);
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * Get the transformer associated with the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     * @return Transformer the transformer associated with the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
    public Transformer getTransformer();
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     * Used only by TransformerSnapshotImpl to restore the serialization
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     * to a previous state.
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     * @param mappings NamespaceMappings
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
    public void setNamespaceMappings(NamespaceMappings mappings);
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * Flush any pending events currently queued up in the serializer. This will
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     * flush any input that the serializer has which it has not yet sent as
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     * output.
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
    public void flushPending() throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     * Default behavior is to expand DTD entities,
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     * that is the initall default value is true.
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     * @param expand true if DTD entities are to be expanded,
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     * false if they are to be left as DTD entity references.
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
    public void setDTDEntityExpansion(boolean expand);
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   127
    /**
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   128
     * Specify if the output will be treated as a standalone  property
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   129
     * @param isStandalone true if the http://www.oracle.com/xml/is-standalone is set to yes
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   130
     * @see OutputPropertiesFactory ORACLE_IS_STANDALONE
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   131
     */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   132
    public void setIsStandalone(boolean b);
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
}