cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: svn commit: rev 47320 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation
Date Mon, 27 Sep 2004 18:00:36 GMT
On 27 Sep 2004, at 18:57, pier@apache.org wrote:

> Author: pier
> Date: Mon Sep 27 10:57:10 2004
> New Revision: 47320
>
> Modified:
>     
> cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/ 
> cocoon/transformation/IncludeTransformer.java
> Log:
> More JavaDOCs, comments, re-indenting, and filtering out the "include"  
> namespaces declarations

I think there's a line-ending problem with this file. My local diffs  
were much smaller!

	Pier (scratching his head, and wondering)

BTW, my local diff was (from a console grab)

$ diff -w IncludeTransformer.java.old IncludeTransformer.java
31a32
 > import org.apache.cocoon.xml.NamespacesTable;
38c39,40
<  * Simple Source include transformer.
---
 >  * <p>A simple transformer including resolvable sources (accessed  
through Cocoon's
 >  * {@link SourceResolver} from its input.</p>
40,44c42,54
<  * <p>
<  *  Triggers for the element <code>include</code> in the
<  *  namespace <code>http://apache.org/cocoon/include/1.0</code>.
<  *  Use <code>&lt;include src="scheme://path"/&gt;</code>
<  * </p>
---
 >  * <p>Inclusion is triggered by the <code>&lt;include ...  
/&gt;</code> element
 >  * defined in the <code>http://apache.org/cocoon/include/1.0</code>  
namespace.</p>
 >  *
 >  * <p>Example:</p>
 >  *
 >  * <p><code>&lt;incl:include  
xmlns="http://apache.org/cocoon/include/1.0"
 >  * src="cocoon://path/to/include"/&gt;</code></p>
 >  *
 >  * <p>An interesting feature of this {@link Transformer} is that it  
implements the
 >  * {@link CacheableProcessingComponent} interface and provides full  
support for
 >  * caching. In other words, if the input given to this transformer  
has not changed,
 >  * and all of the included sources are (cacheable) and still valid,  
this transformer
 >  * will not force a pipeline re-generation like the {@link  
CIncludeTransformer}.</p>
54,55c64
<                                 implements Serviceable, Transformer,
<                                             
CacheableProcessingComponent {
---
 > implements Serviceable, Transformer, CacheableProcessingComponent {
63a73
 >     private NamespacesTable m_namespaces;
64a75,77
 >     /**
 >      * <p>Create a new {@link IncludeTransformer} instance.</p>
 >      */
65a79
 >         super();
67a82,86
 >     /**
 >      * <p>Setup the {@link ServiceManager} available for this  
instance.</p>
 >      *
 >      * @see Serviceable#service(ServiceManager)
 >      */
69c88
<         m_manager = manager;
---
 >         this.m_manager = manager;
71a91,96
 >     /**
 >      * <p>Setup this component instance in the context of its  
pipeline and
 >      * current request.</p>
 >      *
 >      * @see Serviceable#service(ServiceManager)
 >      */
74,75c99,101
<         m_resolver = resolver;
<         m_validity = null;
---
 >         this.m_resolver = resolver;
 >         this.m_validity = null;
 >         this.m_namespaces = new NamespacesTable();
77a104,108
 >     /**
 >      * <p>Recycle this component instance.</p>
 >      *
 >      * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
 >      */
80,81c111,113
<         m_resolver = null;
<         m_validity = null;
---
 >         this.m_resolver = null;
 >         this.m_validity = null;
 >         this.m_namespaces = new NamespacesTable();
83a116,120
 >     /**
 >      * <p>Receive notification of the beginning of an XML  
document.</p>
 >      *
 >      * @see org.xml.sax.ContentHandler#startDocument()
 >      */
86c123
<         // Make sure that we have a validity while processing
---
 >         /* Make sure that we have a validity while processing */
90a128,132
 >     /**
 >      * <p>Receive notification of the end of an XML document.</p>
 >      *
 >      * @see org.xml.sax.ContentHandler#startDocument()
 >      */
93c135
<         // Make sure that the validity is "closed" at the end
---
 >         /* Make sure that the validity is "closed" at the end */
97a140,184
 >     /**
 >      * <p>Receive notification of the start of a prefix mapping.</p>
 >      *
 >      * <p>This transformer will remove all prefix mapping  
declarations for those
 >      * prefixes associated with the  
<code>http://apache.org/cocoon/include/1.0</code>
 >      * namespace.</p>
 >      *
 >      * @see org.xml.sax.ContentHandler#startPrefixMapping(String)
 >      */
 >     public void startPrefixMapping(String prefix, String nsuri)
 >     throws SAXException {
 >         if (NS_URI.equals(nsuri)) {
 >             /* Skipping mapping for the current prefix as it's ours */
 >             this.m_namespaces.addDeclaration(prefix, nsuri);
 >         } else {
 >             /* Map the current prefix, as we don't know it */
 >             super.startPrefixMapping(prefix, nsuri);
 >         }
 >     }
 >
 >     /**
 >      * <p>Receive notification of the end of a prefix mapping.</p>
 >      *
 >      * <p>This transformer will remove all prefix mapping  
declarations for those
 >      * prefixes associated with the  
<code>http://apache.org/cocoon/include/1.0</code>
 >      * namespace.</p>
 >      *
 >      * @see  
org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
 >      */
 >     public void endPrefixMapping(String prefix)
 >     throws SAXException {
 >         if (NS_URI.equals(this.m_namespaces.getUri(prefix))) {
 >             /* Skipping unmapping for the current prefix as it's ours  
*/
 >             this.m_namespaces.removeDeclaration(prefix);
 >         } else {
 >             /* Unmap the current prefix, as we don't know it */
 >             super.endPrefixMapping(prefix);
 >         }
 >     }
 >
 >     /**
 >      * <p>Receive notification of the start of an element.</p>
 >      *
 >      * @see org.xml.sax.ContentHandler#startElement(String, String,  
String, org.xml.sax.Attributes)
 >      */
105a193
 >                     if (m_validity != null) {
107,109c195,196
<                     SourceUtil.toSAX(m_manager,
<                                      source,
<                                      "text/xml",
---
 >                     }
 >                     SourceUtil.toSAX(m_manager, source, "text/xml",
111c198,199
<                 } catch (IOException e) {
---
 >                 }
 >                 catch (IOException e) {
113c201,202
<                 } catch (ProcessingException e) {
---
 >                 }
 >                 catch (ProcessingException e) {
115c204,205
<                 } finally {
---
 >                 }
 >                 finally {
120,121d209
<             } else {
<                 getLogger().warn("Unrecognized element <" + qName +  
">");
128c216,222
<     public void endElement(String uri, String localName, String  
qName) throws SAXException {
---
 >     /**
 >      * <p>Receive notification of the end of an element.</p>
 >      *
 >      * @see org.xml.sax.ContentHandler#endElement(String, String,  
String)
 >      */
 >     public void endElement(String uri, String localName, String qName)
 >     throws SAXException {
133a228,232
 >     /**
 >      * <p>Return the validity key associated with this  
transformation.</p>
 >      *
 >      * @see CacheableProcessingComponent#getKey()
 >      */
139a239,245
 >     /**
 >      * <p>Generate (or return) the {@link SourceValidity} instance  
used to
 >      * possibly validate cached generations.</p>
 >      *
 >      * @return a <b>non null</b> {@link SourceValidity}.
 >      * @see  
org.apache.cocoon.caching.CacheableProcessingComponent#getValidity()
 >      */


Mime
View raw message