avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt XSLTProcessor.java
Date Mon, 01 Jul 2002 01:26:57 GMT
proyal      2002/06/30 18:26:57

  Modified:    xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt
                        XSLTProcessor.java
  Log:
  Further patch from vgritsenko@apache.org for 9905
   * Fixes XSLTProcessor interface to match new impl
   * TransformerHandlerAndValidity modified by proyal to have final
     data members
  
  Revision  Changes    Path
  1.5       +63 -4     jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessor.java
  
  Index: XSLTProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XSLTProcessor.java	2 May 2002 11:29:11 -0000	1.4
  +++ XSLTProcessor.java	1 Jul 2002 01:26:57 -0000	1.5
  @@ -15,7 +15,7 @@
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.excalibur.source.Source;
  -import org.apache.excalibur.source.SourceResolver;
  +import org.apache.excalibur.source.SourceValidity;
   
   /**
    * This is the interface of the XSLT processor.
  @@ -33,6 +33,29 @@
        */
       String ROLE = XSLTProcessor.class.getName();
   
  +    public static class TransformerHandlerAndValidity
  +    {
  +        private final TransformerHandler transformerHandler;
  +        private final SourceValidity transformerValidity;
  +
  +        protected TransformerHandlerAndValidity ( TransformerHandler transformerHandler,
  +                                                  SourceValidity transformerValidity )
  +        {
  +            this.transformerHandler = transformerHandler;
  +            this.transformerValidity = transformerValidity;
  +        }
  +
  +        public TransformerHandler getTransfomerHandler ()
  +        {
  +            return this.transformerHandler;
  +        }
  +
  +        public SourceValidity getTransfomerValidity ()
  +        {
  +            return this.transformerValidity;
  +        }
  +    }
  +
       /**
        * Set the TransformerFactory for this instance.
        * The <code>factory</code> is invoked to return a
  @@ -56,8 +79,9 @@
        * <code>null</code>, is inserted in the chain SAX events as an XML
        * filter during the parsing or the source document.
        *
  -     * <p>This method caches the Source object and performs a reparsing
  -     * only if this changes.
  +     * <p>This method caches the Templates object with meta information
  +     * (modification time and list of included stylesheets) and performs
  +     * a reparsing only if this changes.
        *
        * @param stylesheet a <code>Source</code> value
        * @param filter a <code>XMLFilter</code> value
  @@ -68,6 +92,30 @@
         throws XSLTProcessorException;
   
       /**
  +     * <p>Return a <code>TransformerHandler</code> and
  +     * <code>SourceValidity</code> for a given stylesheet
  +     * <code>Source</code>. This can be used in a pipeline to
  +     * handle the transformation of a stream of SAX events. See {@link
  +     * org.apache.cocoon.transformation.TraxTransformer#setConsumer} for
  +     * an example of how to use this method.
  +     *
  +     * <p>The additional <code>filter</code> argument, if it's not
  +     * <code>null</code>, is inserted in the chain SAX events as an XML
  +     * filter during the parsing or the source document.
  +     *
  +     * <p>This method caches the Templates object with meta information
  +     * (modification time and list of included stylesheets) and performs
  +     * a reparsing only if this changes.
  +     *
  +     * @param stylesheet a <code>Source</code> value
  +     * @param filter a <code>XMLFilter</code> value
  +     * @return a <code>TransformerHandlerAndValidity</code> value
  +     * @exception XSLTProcessorException if an error occurs
  +     */
  +    TransformerHandlerAndValidity getTransformerHandlerAndValidity( Source stylesheet,
XMLFilter filter )
  +      throws XSLTProcessorException;
  +
  +    /**
        * Same as {@link #getTransformerHandler(Source,XMLFilter)}, with
        * <code>filter</code> set to <code>null</code>.
        *
  @@ -76,6 +124,17 @@
        * @exception XSLTProcessorException if an error occurs
        */
       TransformerHandler getTransformerHandler( Source stylesheet )
  +      throws XSLTProcessorException;
  +
  +    /**
  +     * Same as {@link #getTransformerHandlerAndValidity(Source,XMLFilter)}, with
  +     * <code>filter</code> set to <code>null</code>.
  +     *
  +     * @param stylesheet a <code>Source</code> value
  +     * @return a <code>TransformerHandlerAndValidity</code> value
  +     * @exception XSLTProcessorException if an error occurs
  +     */
  +    TransformerHandlerAndValidity getTransformerHandlerAndValidity( Source stylesheet )
         throws XSLTProcessorException;
   
       /**
  
  
  

--
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