avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mirceat...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/sax XMLConsumerProxy.java
Date Wed, 16 Oct 2002 17:22:29 GMT
mirceatoma    2002/10/16 10:22:29

  Added:       xmlutil/src/java/org/apache/excalibur/xml/sax
                        XMLConsumerProxy.java
  Log:
  Rename from XMLConsumerAdapter.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/sax/XMLConsumerProxy.java
  
  Index: XMLConsumerProxy.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.xml.sax;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  import org.xml.sax.ext.LexicalHandler;
  
  /**
   * This class is an utility class proxying a SAX version 2.0
   * {@link ContentHandler} and {@link LexicalHandler) and forwarding it those 
   * events received throug its {@link XMLConsumer}s interface.
   *
   * @author <a href="mailto:mirceatoma@apache.org">Mircea Toma</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/10/16 17:22:29 $
   */
  public class XMLConsumerProxy extends ContentHandlerProxy implements XMLConsumer
  {
      /** The {@link LexicalHandler} */
      private LexicalHandler m_lexicalHandler;
      
      /**
       * Create a new <code>XMLConsumerProxy</code> instance.
       */
      public XMLConsumerProxy(final ContentHandler contentHandler, final LexicalHandler lexicalHandler)
      {
          super(contentHandler);
          m_lexicalHandler = lexicalHandler;
      }
  
      /**
       * Create a new <code>XMLConsumerProxy</code> instance.
       */
      public XMLConsumerProxy(final XMLConsumer xmlConsumer)
      {
          this( xmlConsumer, xmlConsumer );
      }
  
      /**
       * Report the start of DTD declarations, if any.
       *
       * @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.
       */
      public void startDTD( final String name,
                            final String publicId,
                            final String systemId )
          throws SAXException
      {
          m_lexicalHandler.startDTD( name, publicId, systemId );
      }
  
      /**
       * Report the end of DTD declarations.
       */
      public void endDTD()
          throws SAXException
      {
          m_lexicalHandler.endDTD();
      }
  
      /**
       * Report the beginning of an entity.
       *
       * @param name The name of the entity. If it is a parameter entity, the
       *             name will begin with '%'.
       */
      public void startEntity( final String name )
          throws SAXException
      {
          m_lexicalHandler.startEntity( name );
      }
  
      /**
       * Report the end of an entity.
       *
       * @param name The name of the entity that is ending.
       */
      public void endEntity( final String name )
          throws SAXException
      {
          m_lexicalHandler.endEntity( name );
      }
  
      /**
       * Report the start of a CDATA section.
       */
      public void startCDATA()
          throws SAXException
      {
          m_lexicalHandler.startCDATA();
      }
  
      /**
       * Report the end of a CDATA section.
       */
      public void endCDATA()
          throws SAXException
      {
          m_lexicalHandler.endCDATA();
      }
  
      /**
       * Report an XML comment anywhere in the document.
       *
       * @param ch An array holding the characters in the comment.
       * @param start The starting position in the array.
       * @param len The number of characters to use from the array.
       */
      public void comment( final char[] ch,
                           final int start,
                           final int len )
          throws SAXException
      {
          m_lexicalHandler.comment( ch, start, len );
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message