You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2001/06/15 06:08:34 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/xni XMLDocumentHandler.java

andyc       01/06/14 21:08:33

  Modified:    java/src/org/apache/xerces/parsers Tag: xerces_j_2
                        AbstractXMLDocumentParser.java XMLParser.java
               java/src/org/apache/xerces/xni Tag: xerces_j_2
                        XMLDocumentHandler.java
  Log:
  Minor updates. I changed the code entered by lehors on 19 Jun.
  Instead of overriding parse() to call reset(), the base parser
  class has a protected reset method that *its* parse method
  calls. So noone down the inheritence chain has to override
  parse just to call reset. And since overriders of reset are
  required to call super.reset(), I think this solution is
  better.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +2 -20     xml-xerces/java/src/org/apache/xerces/parsers/Attic/AbstractXMLDocumentParser.java
  
  Index: AbstractXMLDocumentParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/Attic/AbstractXMLDocumentParser.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- AbstractXMLDocumentParser.java	2001/05/19 00:28:35	1.1.2.7
  +++ AbstractXMLDocumentParser.java	2001/06/15 04:08:32	1.1.2.8
  @@ -82,7 +82,7 @@
    * @author Arnaud  Le Hors, IBM
    * @author Andy Clark, IBM
    *
  - * @version $Id: AbstractXMLDocumentParser.java,v 1.1.2.7 2001/05/19 00:28:35 lehors Exp $
  + * @version $Id: AbstractXMLDocumentParser.java,v 1.1.2.8 2001/06/15 04:08:32 andyc Exp $
    */
   public abstract class AbstractXMLDocumentParser
       extends XMLParser
  @@ -113,25 +113,6 @@
       } // <init>(XMLParserConfiguration)
   
       //
  -    // Public methods
  -    //
  -
  -    /**
  -     * parse
  -     *
  -     * @param inputSource
  -     *
  -     * @exception org.xml.sax.SAXException
  -     * @exception java.io.IOException
  -     */
  -    public void parse(InputSource inputSource) 
  -        throws SAXException, IOException {
  -
  -        reset();
  -        super.parse(inputSource);
  -    }
  -
  -    //
       // XMLDocumentHandler methods
       //
   
  @@ -710,6 +691,7 @@
        * reset all components before parsing
        */
       protected void reset() throws SAXException {
  +        super.reset();
           fInDTD = false;
       } // reset()
   
  
  
  
  1.1.2.26  +12 -1     xml-xerces/java/src/org/apache/xerces/parsers/Attic/XMLParser.java
  
  Index: XMLParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/Attic/XMLParser.java,v
  retrieving revision 1.1.2.25
  retrieving revision 1.1.2.26
  diff -u -r1.1.2.25 -r1.1.2.26
  --- XMLParser.java	2001/05/09 07:20:47	1.1.2.25
  +++ XMLParser.java	2001/06/15 04:08:32	1.1.2.26
  @@ -91,7 +91,7 @@
    * @author Arnaud  Le Hors, IBM
    * @author Andy Clark, IBM
    *
  - * @version $Id: XMLParser.java,v 1.1.2.25 2001/05/09 07:20:47 andyc Exp $
  + * @version $Id: XMLParser.java,v 1.1.2.26 2001/06/15 04:08:32 andyc Exp $
    */
   public abstract class XMLParser {
   
  @@ -192,6 +192,7 @@
           throws SAXException, IOException {
   
           try {
  +            reset();
               fConfiguration.parse(inputSource);
           }
           catch (XNIException e) {
  @@ -388,5 +389,15 @@
           return fConfiguration.getProperty(propertyId);
   
       } // getProperty(String):Object
  +
  +    //
  +    // Protected methods
  +    //
  +
  +    /**
  +     * reset all components before parsing
  +     */
  +    protected void reset() throws SAXException {
  +    } // reset()
   
   } // class XMLParser
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.10  +53 -53    xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentHandler.java
  
  Index: XMLDocumentHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentHandler.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- XMLDocumentHandler.java	2001/05/09 07:20:57	1.1.2.9
  +++ XMLDocumentHandler.java	2001/06/15 04:08:33	1.1.2.10
  @@ -66,7 +66,7 @@
    * @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
    * @author Andy Clark, IBM
    *
  - * @version $Id: XMLDocumentHandler.java,v 1.1.2.9 2001/05/09 07:20:57 andyc Exp $
  + * @version $Id: XMLDocumentHandler.java,v 1.1.2.10 2001/06/15 04:08:33 andyc Exp $
    */
   public interface XMLDocumentHandler {
   
  @@ -75,46 +75,6 @@
       //
   
       /**
  -     * This method notifies the start of an entity.
  -     * <p>
  -     * <strong>Note:</strong> This method is not called for entity references
  -     * appearing as part of attribute values.
  -     * 
  -     * @param name     The name of the entity.
  -     * @param publicId The public identifier of the entity if the entity
  -     *                 is external, null otherwise.
  -     * @param systemId The system identifier of the entity if the entity
  -     *                 is external, null otherwise.
  -     * @param encoding The auto-detected IANA encoding name of the entity
  -     *                 stream. This value will be null in those situations
  -     *                 where the entity encoding is not auto-detected (e.g.
  -     *                 internal entities or a document entity that is
  -     *                 parsed from a java.io.Reader).
  -     *
  -     * @throws XNIException Thrown by handler to signal an error.
  -     */
  -    public void startEntity(String name, String publicId, String systemId,
  -                            String encoding) throws XNIException;
  -
  -    /**
  -     * Notifies of the presence of a TextDecl line in an entity. If present,
  -     * this method will be called immediately following the startEntity call.
  -     * <p>
  -     * <strong>Note:</strong> This method will never be called for the
  -     * document entity; it is only called for external general entities
  -     * referenced in document content.
  -     * <p>
  -     * <strong>Note:</strong> This method is not called for entity references
  -     * appearing as part of attribute values.
  -     * 
  -     * @param version  The XML version, or null if not specified.
  -     * @param encoding The IANA encoding name of the entity.
  -     *
  -     * @throws XNIException Thrown by handler to signal an error.
  -     */
  -    public void textDecl(String version, String encoding) throws XNIException;
  -
  -    /**
        * The start of the document.
        *
        * @param systemId The system identifier of the entity if the entity
  @@ -222,6 +182,58 @@
           throws XNIException;
   
       /**
  +     * This method notifies the start of an entity.
  +     * <p>
  +     * <strong>Note:</strong> This method is not called for entity references
  +     * appearing as part of attribute values.
  +     * 
  +     * @param name     The name of the entity.
  +     * @param publicId The public identifier of the entity if the entity
  +     *                 is external, null otherwise.
  +     * @param systemId The system identifier of the entity if the entity
  +     *                 is external, null otherwise.
  +     * @param encoding The auto-detected IANA encoding name of the entity
  +     *                 stream. This value will be null in those situations
  +     *                 where the entity encoding is not auto-detected (e.g.
  +     *                 internal entities or a document entity that is
  +     *                 parsed from a java.io.Reader).
  +     *
  +     * @throws XNIException Thrown by handler to signal an error.
  +     */
  +    public void startEntity(String name, String publicId, String systemId,
  +                            String encoding) throws XNIException;
  +
  +    /**
  +     * Notifies of the presence of a TextDecl line in an entity. If present,
  +     * this method will be called immediately following the startEntity call.
  +     * <p>
  +     * <strong>Note:</strong> This method will never be called for the
  +     * document entity; it is only called for external general entities
  +     * referenced in document content.
  +     * <p>
  +     * <strong>Note:</strong> This method is not called for entity references
  +     * appearing as part of attribute values.
  +     * 
  +     * @param version  The XML version, or null if not specified.
  +     * @param encoding The IANA encoding name of the entity.
  +     *
  +     * @throws XNIException Thrown by handler to signal an error.
  +     */
  +    public void textDecl(String version, String encoding) throws XNIException;
  +
  +    /**
  +     * This method notifies the end of an entity.
  +     * <p>
  +     * <strong>Note:</strong> This method is not called for entity references
  +     * appearing as part of attribute values.
  +     * 
  +     * @param name The name of the entity.
  +     *
  +     * @throws XNIException Thrown by handler to signal an error.
  +     */
  +    public void endEntity(String name) throws XNIException;
  +
  +    /**
        * Character content.
        * 
        * @param text The content.
  @@ -283,17 +295,5 @@
        * @throws XNIException Thrown by handler to signal an error.
        */
       public void endDocument() throws XNIException;
  -
  -    /**
  -     * This method notifies the end of an entity.
  -     * <p>
  -     * <strong>Note:</strong> This method is not called for entity references
  -     * appearing as part of attribute values.
  -     * 
  -     * @param name The name of the entity.
  -     *
  -     * @throws XNIException Thrown by handler to signal an error.
  -     */
  -    public void endEntity(String name) throws XNIException;
   
   } // interface XMLDocumentHandler
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org