transformeridentityimpl.java

来自「java jdk 1.4的源码」· Java 代码 · 共 1,425 行 · 第 1/4 页

JAVA
1,425
字号
  {    flushStartDoc();    m_resultContentHandler.characters(ch, start, length);  }  /**   * Receive notification of ignorable whitespace in element content.   *   * <p>By default, do nothing.  Application writers may override this   * method to take specific actions for each chunk of ignorable   * whitespace (such as adding data to a node or buffer, or printing   * it to a file).</p>   *   * @param ch The whitespace characters.   * @param start The start position in the character array.   * @param length The number of characters to use from the   *               character array.   * @throws org.xml.sax.SAXException Any SAX exception, possibly   *            wrapping another exception.   * @see org.xml.sax.ContentHandler#ignorableWhitespace   *   * @throws SAXException   */  public void ignorableWhitespace(char ch[], int start, int length)          throws SAXException  {    m_resultContentHandler.ignorableWhitespace(ch, start, length);  }  /**   * Receive notification of a processing instruction.   *   * <p>By default, do nothing.  Application writers may override this   * method in a subclass to take specific actions for each   * processing instruction, such as setting status variables or   * invoking other methods.</p>   *   * @param target The processing instruction target.   * @param data The processing instruction data, or null if   *             none is supplied.   * @throws org.xml.sax.SAXException Any SAX exception, possibly   *            wrapping another exception.   * @see org.xml.sax.ContentHandler#processingInstruction   *   * @throws SAXException   */  public void processingInstruction(String target, String data)          throws SAXException  {    flushStartDoc();    m_resultContentHandler.processingInstruction(target, data);  }  /**   * Receive notification of a skipped entity.   *   * <p>By default, do nothing.  Application writers may override this   * method in a subclass to take specific actions for each   * processing instruction, such as setting status variables or   * invoking other methods.</p>   *   * @param name The name of the skipped entity.   * @throws org.xml.sax.SAXException Any SAX exception, possibly   *            wrapping another exception.   * @see org.xml.sax.ContentHandler#processingInstruction   *   * @throws SAXException   */  public void skippedEntity(String name) throws SAXException  {    flushStartDoc();    m_resultContentHandler.skippedEntity(name);  }  /**   * Report the start of DTD declarations, if any.   *   * <p>Any declarations are assumed to be in the internal subset   * unless otherwise indicated by a {@link #startEntity startEntity}   * event.</p>   *   * <p>Note that the start/endDTD events will appear within   * the start/endDocument events from ContentHandler and   * before the first startElement event.</p>   *   * @param name The document type name.   * @param publicId The declared public identifier for the   *        external DTD subset, or null if none was declared.   * @param systemId The declared system identifier for the   *        external DTD subset, or null if none was declared.   * @throws SAXException The application may raise an   *            exception.   * @see #endDTD   * @see #startEntity   */  public void startDTD(String name, String publicId, String systemId)          throws SAXException  {    flushStartDoc();    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.startDTD(name, publicId, systemId);  }  /**   * Report the end of DTD declarations.   *   * @throws SAXException The application may raise an exception.   * @see #startDTD   */  public void endDTD() throws SAXException  {    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.endDTD();  }  /**   * Report the beginning of an entity in content.   *   * <p><strong>NOTE:</entity> entity references in attribute   * values -- and the start and end of the document entity --   * are never reported.</p>   *   * <p>The start and end of the external DTD subset are reported   * using the pseudo-name "[dtd]".  All other events must be   * properly nested within start/end entity events.</p>   *   * <p>Note that skipped entities will be reported through the   * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}   * event, which is part of the ContentHandler interface.</p>   *   * @param name The name of the entity.  If it is a parameter   *        entity, the name will begin with '%'.   * @throws SAXException The application may raise an exception.   * @see #endEntity   * @see org.xml.sax.ext.DeclHandler#internalEntityDecl   * @see org.xml.sax.ext.DeclHandler#externalEntityDecl   */  public void startEntity(String name) throws SAXException  {    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.startEntity(name);  }  /**   * Report the end of an entity.   *   * @param name The name of the entity that is ending.   * @throws SAXException The application may raise an exception.   * @see #startEntity   */  public void endEntity(String name) throws SAXException  {    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.endEntity(name);  }  /**   * Report the start of a CDATA section.   *   * <p>The contents of the CDATA section will be reported through   * the regular {@link org.xml.sax.ContentHandler#characters   * characters} event.</p>   *   * @throws SAXException The application may raise an exception.   * @see #endCDATA   */  public void startCDATA() throws SAXException  {    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.startCDATA();  }  /**   * Report the end of a CDATA section.   *   * @throws SAXException The application may raise an exception.   * @see #startCDATA   */  public void endCDATA() throws SAXException  {    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.endCDATA();  }  /**   * Report an XML comment anywhere in the document.   *   * <p>This callback will be used for comments inside or outside the   * document element, including comments in the external DTD   * subset (if read).</p>   *   * @param ch An array holding the characters in the comment.   * @param start The starting position in the array.   * @param length The number of characters to use from the array.   * @throws SAXException The application may raise an exception.   */  public void comment(char ch[], int start, int length) throws SAXException  {    flushStartDoc();    if (null != m_resultLexicalHandler)      m_resultLexicalHandler.comment(ch, start, length);  }    // Implement DeclHandler    /**     * Report an element type declaration.     *     * <p>The content model will consist of the string "EMPTY", the     * string "ANY", or a parenthesised group, optionally followed     * by an occurrence indicator.  The model will be normalized so     * that all whitespace is removed,and will include the enclosing     * parentheses.</p>     *     * @param name The element type name.     * @param model The content model as a normalized string.     * @exception SAXException The application may raise an exception.     */    public void elementDecl (String name, String model)        throws SAXException    {                        if (null != m_resultDeclHandler)                                m_resultDeclHandler.elementDecl(name, model);    }    /**     * Report an attribute type declaration.     *     * <p>Only the effective (first) declaration for an attribute will     * be reported.  The type will be one of the strings "CDATA",     * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",     * "ENTITIES", or "NOTATION", or a parenthesized token group with      * the separator "|" and all whitespace removed.</p>     *     * @param eName The name of the associated element.     * @param aName The name of the attribute.     * @param type A string representing the attribute type.     * @param valueDefault A string representing the attribute default     *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if     *        none of these applies.     * @param value A string representing the attribute's default value,     *        or null if there is none.     * @exception SAXException The application may raise an exception.     */    public void attributeDecl (String eName,                                        String aName,                                        String type,                                        String valueDefault,                                        String value)        throws SAXException    {      if (null != m_resultDeclHandler)                                m_resultDeclHandler.attributeDecl(eName, aName, type, valueDefault, value);    }    /**     * Report an internal entity declaration.     *     * <p>Only the effective (first) declaration for each entity     * will be reported.</p>     *     * @param name The name of the entity.  If it is a parameter     *        entity, the name will begin with '%'.     * @param value The replacement text of the entity.     * @exception SAXException The application may raise an exception.     * @see #externalEntityDecl     * @see org.xml.sax.DTDHandler#unparsedEntityDecl     */    public void internalEntityDecl (String name, String value)        throws SAXException    {      if (null != m_resultDeclHandler)                                m_resultDeclHandler.internalEntityDecl(name, value);     }    /**     * Report a parsed external entity declaration.     *     * <p>Only the effective (first) declaration for each entity     * will be reported.</p>     *     * @param name The name of the entity.  If it is a parameter     *        entity, the name will begin with '%'.     * @param publicId The declared public identifier of the entity, or     *        null if none was declared.     * @param systemId The declared system identifier of the entity.     * @exception SAXException The application may raise an exception.     * @see #internalEntityDecl     * @see org.xml.sax.DTDHandler#unparsedEntityDecl     */    public void externalEntityDecl (String name, String publicId,                                             String systemId)        throws SAXException    {      if (null != m_resultDeclHandler)                                m_resultDeclHandler.externalEntityDecl(name, publicId, systemId);    }    /**   * This is null unless we own the stream.   */  private java.io.FileOutputStream m_outputStream = null;  /** The content handler where result events will be sent. */  private ContentHandler m_resultContentHandler;  /** The lexical handler where result events will be sent. */  private LexicalHandler m_resultLexicalHandler;  /** The DTD handler where result events will be sent. */  private DTDHandler m_resultDTDHandler;    /** The Decl handler where result events will be sent. */  private DeclHandler m_resultDeclHandler;  /** The Serializer, which may or may not be null. */  private Serializer m_serializer;  /** The Result object. */  private Result m_result;  /**   * The system ID, which is unused, but must be returned to fullfill the   *  TransformerHandler interface.   */  private String m_systemID;  /**   * The parameters, which is unused, but must be returned to fullfill the   *  Transformer interface.   */  private Hashtable m_params;  /** The error listener for TrAX errors and warnings. */  private ErrorListener m_errorListener =    new org.apache.xml.utils.DefaultErrorHandler();  /**   * The URIResolver, which is unused, but must be returned to fullfill the   *  TransformerHandler interface.   */  URIResolver m_URIResolver;  /** The output properties. */  private OutputProperties m_outputFormat;  /** Flag to set if we've found the first element, so we can tell if we have    *  to check to see if we should create an HTML serializer.      */  boolean m_foundFirstElement;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?