You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@locus.apache.org on 2000/02/25 17:12:30 UTC

cvs commit: xml-xalan/src/org/apache/xalan/xslt/trace GenerateEvent.java PrintTraceListener.java SelectionEvent.java TraceListener.java TracerEvent.java

dleslie     00/02/25 08:12:30

  Modified:    src/org/apache/xalan/xslt/trace GenerateEvent.java
                        PrintTraceListener.java SelectionEvent.java
                        TraceListener.java TracerEvent.java
  Log:
  javadoc cleanup SPR #DMAN4FYPWC
  
  Revision  Changes    Path
  1.2       +66 -62    xml-xalan/src/org/apache/xalan/xslt/trace/GenerateEvent.java
  
  Index: GenerateEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/trace/GenerateEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GenerateEvent.java	1999/11/08 20:56:43	1.1
  +++ GenerateEvent.java	2000/02/25 16:12:29	1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,15 +18,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "XSLT4J" and "Apache Software Foundation" must
  + * 4. The names "Xalan" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -61,113 +61,117 @@
   import java.io.*;
   import org.apache.xalan.xslt.*;
   
  -/** 
  - * This is the class for events generated by the XSL processor
  - * after it generates a new node in the result tree.  It responds
  - * to, and so is modeled from, the SAX events that are sent to the
  - * FormatterListener classes.
  - * 
  - * @see org.apache.xalan.xpath.xml.FormatterListener
  +/**
  + * Event generated by the XSL processor after it generates a new node in the result tree.
  + * This event responds to and is modeled on the SAX events that are sent to the
  + * formatter listener FormatterToXXX)classes.
  + *
  + * @see org.apache.xalan.xpath.xml.FormatterToDOM
  + * @see org.apache.xalan.xpath.xml.FormatterToHTML
  + * @see org.apache.xalan.xpath.xml.FormatterToText
  + * @see org.apache.xalan.xpath.xml.FormatterToXML
  +
    */
   public class GenerateEvent  implements java.util.EventListener
   {
  -  /** 
  -   * The XSLT Processor, which either directly or indirectly contains most needed information.  Accessing the m_stylesheetRoot member variable will get you to the stylesheet information.
  -   * 
  -   * @see org.apache.xalan.xslt.XSLTEngineImpl, org.apache.xalan.xslt.StylesheetRoot, 
  +  /**
  +   * The XSLT Processor, which either directly or indirectly contains most needed information.
  +   * Accessing the m_stylesheetRoot member variable will get you to the stylesheet information.
  +   *
  +   * @see org.apache.xalan.xslt.XSLTEngineImpl, org.apache.xalan.xslt.StylesheetRoot,
      *     org.apache.xalan.xslt.Stylesheet
      */
     public XSLTEngineImpl m_processor;
  -  
  -  /** 
  +
  +  /**
      * The type of SAX event that was generated, as enumerated in the EVENTTYPE_XXX constants below.
      */
     public int m_eventtype;
  -  
  -  /** 
  +
  +  /**
      * Event type generated when a document begins.
  -   * 
  +   *
      */
     public static final int EVENTTYPE_STARTDOCUMENT = 1;
  -  
  -  /** 
  +
  +  /**
      * Event type generated when a document ends.
      */
     public static final int EVENTTYPE_ENDDOCUMENT = 2;
  -  
  -  /** 
  +
  +  /**
      * Event type generated when an element begins (after the attributes have been processed but before the children have been added).
      */
     public static final int EVENTTYPE_STARTELEMENT = 3;
  -  
  -  /** 
  +
  +  /**
      * Event type generated when an element ends, after it's children have been added.
      */
     public static final int EVENTTYPE_ENDELEMENT = 4;
  -  
  -  /** 
  +
  +  /**
      * Event type generated for character data (CDATA and Ignorable Whitespace have their own events).
      */
     public static final int EVENTTYPE_CHARACTERS = 5;
  -  
  -  /** 
  +
  +  /**
      * Event type generated for ignorable whitespace (I'm not sure how much this is actually called.
      */
     public static final int EVENTTYPE_IGNORABLEWHITESPACE = 6;
  -  
  -  /** 
  +
  +  /**
      * Event type generated for processing instructions.
      */
     public static final int EVENTTYPE_PI = 7;
  -  
  -  /** 
  +
  +  /**
      * Event type generated after a comment has been added.
      */
     public static final int EVENTTYPE_COMMENT = 8;
  -  
  -  /** 
  +
  +  /**
      * Event type generate after an entity ref is created.
      */
     public static final int EVENTTYPE_ENTITYREF = 9;
  -  
  -  /** 
  +
  +  /**
      * Event type generated after CDATA is generated.
      */
     public static final int EVENTTYPE_CDATA = 10;
  -  
  -  /** 
  +
  +  /**
      * Character data from a character or cdata event.
      */
     public char m_characters[];
  -  
  -  /** 
  +
  +  /**
      * The start position of the current data in m_characters.
      */
     public int m_start;
  -  
  -  /** 
  +
  +  /**
      * The length of the current data in m_characters.
      */
     public int m_length;
   
  -  /** 
  +  /**
      * The name of the element or PI.
      */
     public String m_name;
   
  -  /** 
  +  /**
      * The string data in the element (comments and PIs).
      */
     public String m_data;
   
  -  /** 
  +  /**
      * The current attribute list.
      */
     public AttributeList m_atts;
  -  
  -  /** 
  +
  +  /**
      * Constructor for startDocument, endDocument events.
  -   * 
  +   *
      * @param processor The XSLT Processor instance.
      * @param eventType One of the EVENTTYPE_XXX constants.
      */
  @@ -176,10 +180,10 @@
       m_processor = processor;
       m_eventtype = eventType;
     }
  -  
  -  /** 
  +
  +  /**
      * Constructor for startElement, endElement events.
  -   * 
  +   *
      * @param processor The XSLT Processor Instance.
      * @param eventType One of the EVENTTYPE_XXX constants.
      * @param name The name of the element.
  @@ -193,10 +197,10 @@
       m_processor = processor;
       m_eventtype = eventType;
     }
  -  
  -  /** 
  +
  +  /**
      * Constructor for characters, cdate events.
  -   * 
  +   *
      * @param processor The XSLT Processor instance.
      * @param eventType One of the EVENTTYPE_XXX constants.
      * @param ch The char array from the SAX event.
  @@ -213,9 +217,9 @@
       m_eventtype = eventType;
     }
   
  -  /** 
  +  /**
      * Constructor for processingInstruction events.
  -   * 
  +   *
      * @param processor The instance of the XSLT processor.
      * @param eventType One of the EVENTTYPE_XXX constants.
      * @param name The name of the processing instruction.
  @@ -229,10 +233,10 @@
       m_processor = processor;
       m_eventtype = eventType;
     }
  -  
  -  /** 
  +
  +  /**
      * Constructor for comment and entity ref events.
  -   * 
  +   *
      * @param processor The XSLT processor instance.
      * @param eventType One of the EVENTTYPE_XXX constants.
      * @param data The comment or entity ref data.
  
  
  
  1.4       +28 -28    xml-xalan/src/org/apache/xalan/xslt/trace/PrintTraceListener.java
  
  Index: PrintTraceListener.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/trace/PrintTraceListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PrintTraceListener.java	2000/01/24 23:06:25	1.3
  +++ PrintTraceListener.java	2000/02/25 16:12:29	1.4
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,15 +18,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "XSLT4J" and "Apache Software Foundation" must
  + * 4. The names "Xalan" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -61,10 +61,10 @@
   import org.w3c.dom.*;
   import org.apache.xalan.xslt.*;
   
  -/** 
  - * This implementation of the TraceListener interface
  +/**
  + * Implementation of the TraceListener interface that
    * prints each event to standard out as it occurs.
  - * 
  + *
    * @see TracerEvent.java
    */
   public class PrintTraceListener implements TraceListener
  @@ -76,35 +76,35 @@
     {
       m_pw = pw;
     }
  -  
  +
     /**
  -   * The print writer where the events should be written to.
  +   * The print writer where the events should be written.
      */
     java.io.PrintWriter m_pw;
  -  
  -  /** 
  +
  +  /**
      * This needs to be set to true if the listener is to print an event whenever a template is invoked.
      */
     public boolean m_traceTemplates = false;
  -  
  -  /** 
  -   * This needs to be set to true if the listener is to print events that occur as each node is 'executed' in the stylesheet.
  +
  +  /**
  +   * Set to true if the listener is to print events that occur as each node is 'executed' in the stylesheet.
      */
     public boolean m_traceElements = false;
  -  
  -  /** 
  -   * This needs to be set to true if the listener is to print information after each result-tree generation event.
  +
  +  /**
  +   * Set to true if the listener is to print information after each result-tree generation event.
      */
     public boolean m_traceGeneration = false;
   
  -  /** 
  -   * This needs to be set to true if the listener is to print information after each selection event.
  +  /**
  +   * Set to true if the listener is to print information after each selection event.
      */
     public boolean m_traceSelection = false;
   
  -  /** 
  +  /**
      * Print information about a TracerEvent.
  -   * 
  +   *
      * @param ev the trace event.
      */
     public void trace(TracerEvent ev)
  @@ -147,10 +147,10 @@
                              "Column #"+ev.m_styleNode.m_columnNumber+": "+
                              ev.m_styleNode.m_elemName);
         }
  -      
  +
       }
     }
  -  
  +
     /**
      * Method that is called just after the formatter listener is called.
      *
  @@ -208,12 +208,12 @@
         {
           m_pw.println(ev.m_selection.str());
         }
  -    }    
  +    }
     }
   
  -  /** 
  +  /**
      * Print information about a Generate event.
  -   * 
  +   *
      * @param ev the trace event.
      */
     public void generated(GenerateEvent ev)
  @@ -257,7 +257,7 @@
           break;
         case ev.EVENTTYPE_IGNORABLEWHITESPACE:
           m_pw.println("IGNORABLEWHITESPACE");
  -        break;     
  +        break;
         }
       }
     }
  
  
  
  1.2       +16 -12    xml-xalan/src/org/apache/xalan/xslt/trace/SelectionEvent.java
  
  Index: SelectionEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/trace/SelectionEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SelectionEvent.java	1999/11/08 20:56:44	1.1
  +++ SelectionEvent.java	2000/02/25 16:12:29	1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,15 +18,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "XSLT4J" and "Apache Software Foundation" must
  + * 4. The names "Xalan" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -62,33 +62,37 @@
   import org.apache.xalan.xpath.XPath;
   import org.apache.xalan.xpath.XObject;
   
  +/**
  + * Event triggered by selection of a node in the style stree.
  + *
  + */
   public class SelectionEvent implements java.util.EventListener
   {
     /**
      * The node in the style tree where the event occurs.
      */
     public final ElemTemplateElement m_styleNode;
  -  
  +
     /**
      * The XSLT processor instance.
      */
     public final XSLTEngineImpl m_processor;
  -    
  +
     /**
      * The current context node.
      */
     public final Node m_sourceNode;
  -  
  +
     /**
      * The attribute name from which the selection is made.
      */
     public final String m_attributeName;
  -  
  +
     /**
      * The XPath that executed the selection.
      */
     public final XPath m_xpath;
  -  
  +
     /**
      * The result of the selection.
      */
  @@ -103,12 +107,12 @@
      * @param m_styleNode node in the style tree reference for the event.
      * Should not be null.  That is not enforced.
      */
  -  public SelectionEvent(XSLTEngineImpl processor, 
  +  public SelectionEvent(XSLTEngineImpl processor,
                        Node sourceNode,
                        ElemTemplateElement styleNode,
                        String attributeName,
                        XPath xpath,
  -                     XObject selection) 
  +                     XObject selection)
     {
       this.m_processor = processor;
       this.m_sourceNode = sourceNode;
  
  
  
  1.3       +10 -12    xml-xalan/src/org/apache/xalan/xslt/trace/TraceListener.java
  
  Index: TraceListener.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/trace/TraceListener.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TraceListener.java	1999/11/28 04:25:16	1.2
  +++ TraceListener.java	2000/02/25 16:12:29	1.3
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,15 +18,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "XSLT4J" and "Apache Software Foundation" must
  + * 4. The names "Xalan" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -59,13 +59,11 @@
   import org.w3c.dom.*;
   
   /**
  - * This is the interface that the XSL processor calls when it
  - * matches a source node, selects a set of source nodes, or
  - * generates a result node.
  - * Users should ask the XSLTEngineImpl class to setTraceListener
  - * if they wish an object instance to be called when a trace
  - * event occurs.
  + * Interface the XSL processor calls when it matches a source node, selects a set of source nodes,
  + * or generates a result node.
  + * If you want an object instance to be called when a trace event occurs, use the XSLTEngineImpl setTraceListener method.
    * @see TracerEvent.java
  + * @see org.apache.xalan.xslt.XSLTEngineImpl#setTraceListener
    */
   public interface TraceListener extends java.util.EventListener
   {
  @@ -76,7 +74,7 @@
      * @param ev the trace event.
      */
     public void trace(TracerEvent ev);
  -  
  +
     /**
      * Method that is called just after the formatter listener is called.
      *
  
  
  
  1.2       +12 -12    xml-xalan/src/org/apache/xalan/xslt/trace/TracerEvent.java
  
  Index: TracerEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/trace/TracerEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TracerEvent.java	1999/11/08 20:56:44	1.1
  +++ TracerEvent.java	2000/02/25 16:12:29	1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,15 +18,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "XSLT4J" and "Apache Software Foundation" must
  + * 4. The names "Xalan" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -61,7 +61,7 @@
   import org.apache.xalan.xpath.xml.QName;
   
   /**
  - * This is the parent class of events generated for tracing the
  + * Parent class of events generated for tracing the
    * progress of the XSL processor.
    */
   public class TracerEvent implements java.util.EventListener
  @@ -70,22 +70,22 @@
      * The node in the style tree where the event occurs.
      */
     public final ElemTemplateElement m_styleNode;
  -  
  +
     /**
      * The XSLT processor instance.
      */
     public final XSLTEngineImpl m_processor;
  -  
  +
     /**
      * The input source tree.
      */
     public final Node m_sourceTree;
  -  
  +
     /**
      * The current context node.
      */
     public final Node m_sourceNode;
  -  
  +
     /**
      * The current mode.
      */
  @@ -100,8 +100,8 @@
      * @param m_styleNode node in the style tree reference for the event.
      * Should not be null.  That is not enforced.
      */
  -  public TracerEvent(XSLTEngineImpl processor, 
  -                     Node sourceTree, 
  +  public TracerEvent(XSLTEngineImpl processor,
  +                     Node sourceTree,
                        Node sourceNode,
                        QName mode,
                        ElemTemplateElement styleNode)