jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java
author joehw
Tue, 29 Jul 2014 20:52:36 -0700
changeset 25834 aba3efbf4ec5
parent 12457 c348e06f0e82
permissions -rw-r--r--
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer. Reviewed-by: lancea
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 1999-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: SerializerTrace.java,v 1.2.4.1 2005/09/15 08:15:24 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 org.xml.sax.Attributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 * This interface defines a set of integer constants that identify trace event
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 * types.
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * @xsl.usage internal
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
public interface SerializerTrace {
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
   * Event type generated when a document begins.
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
  public static final int EVENTTYPE_STARTDOCUMENT = 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
   * Event type generated when a document ends.
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
  public static final int EVENTTYPE_ENDDOCUMENT = 2;
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
   * Event type generated when an element begins (after the attributes have been processed but before the children have been added).
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
  public static final int EVENTTYPE_STARTELEMENT = 3;
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
   * Event type generated when an element ends, after it's children have been added.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
  public static final int EVENTTYPE_ENDELEMENT = 4;
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
   * Event type generated for character data (CDATA and Ignorable Whitespace have their own events).
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
  public static final int EVENTTYPE_CHARACTERS = 5;
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
   * Event type generated for ignorable whitespace (I'm not sure how much this is actually called.
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
  public static final int EVENTTYPE_IGNORABLEWHITESPACE = 6;
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
   * Event type generated for processing instructions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
  public static final int EVENTTYPE_PI = 7;
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
   * Event type generated after a comment has been added.
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
  public static final int EVENTTYPE_COMMENT = 8;
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
   * Event type generate after an entity ref is created.
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
  public static final int EVENTTYPE_ENTITYREF = 9;
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
   * Event type generated after CDATA is generated.
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
  public static final int EVENTTYPE_CDATA = 10;
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
   * Event type generated when characters might be written to an output stream,
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
   *  but  these characters never are. They will ultimately be written out via
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
   * EVENTTYPE_OUTPUT_CHARACTERS. This type is used as attributes are collected.
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   * Whenever the attributes change this event type is fired. At the very end
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
   * however, when the attributes do not change anymore and are going to be
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
   * ouput to the document the real characters will be written out using the
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
   * EVENTTYPE_OUTPUT_CHARACTERS.
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
  public static final int EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS = 11;
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
   * Event type generated when characters are written to an output stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
  public static final int EVENTTYPE_OUTPUT_CHARACTERS = 12;
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
   * Tell if trace listeners are present.
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
   * @return True if there are trace listeners
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
  public boolean hasTraceListeners();
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
   * Fire startDocument, endDocument events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
   * @param eventType One of the EVENTTYPE_XXX constants.
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
  public void fireGenerateEvent(int eventType);
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
   * Fire startElement, endElement events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
   * @param eventType One of the EVENTTYPE_XXX constants.
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
   * @param name The name of the element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
   * @param atts The SAX attribute list.
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
  public void fireGenerateEvent(int eventType, String name, Attributes atts);
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
   * Fire characters, cdata events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
   * @param eventType One of the EVENTTYPE_XXX constants.
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
   * @param ch The char array from the SAX event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
   * @param start The start offset to be used in the char array.
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
   * @param length The end offset to be used in the chara array.
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
  public void fireGenerateEvent(int eventType, char ch[], int start, int length);
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
   * Fire processingInstruction events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
   * @param eventType One of the EVENTTYPE_XXX constants.
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
   * @param name The name of the processing instruction.
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
   * @param data The processing instruction data.
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
  public void fireGenerateEvent(int eventType, String name, String data);
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
   * Fire comment and entity ref events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
   * @param eventType One of the EVENTTYPE_XXX constants.
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
   * @param data The comment or entity ref data.
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
  public void fireGenerateEvent(int eventType, String data);
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
}