You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/12/19 16:50:48 UTC

svn commit: r605591 - in /cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation: HTMLGenerator.java NekoHTMLGenerator.java

Author: vgritsenko
Date: Wed Dec 19 07:50:47 2007
New Revision: 605591

URL: http://svn.apache.org/viewvc?rev=605591&view=rev
Log:
javadoc

Modified:
    cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/HTMLGenerator.java
    cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/NekoHTMLGenerator.java

Modified: cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/HTMLGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/HTMLGenerator.java?rev=605591&r1=605590&r2=605591&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/HTMLGenerator.java (original)
+++ cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/HTMLGenerator.java Wed Dec 19 07:50:47 2007
@@ -53,21 +53,22 @@
 import org.xml.sax.SAXException;
 
 /**
- * @cocoon.sitemap.component.documentation
- * The html generator reads HTML from a source, converts it to XHTML
- * and generates SAX Events.
+ * The HTML generator reads HTML from a source, converts it to XHTML
+ * using JTidy and generates SAX Events.
  *
+ * @cocoon.sitemap.component.documentation
+ * The HTML generator reads HTML from a source, converts it to XHTML
+ * using JTidy and generates SAX Events.
  * @cocoon.sitemap.component.name   html
  * @cocoon.sitemap.component.label  content
- * @cocoon.sitemap.component.documentation.caching
- *               Uses the last modification date of the xml document for validation
- *
+ * @cocoon.sitemap.component.documentation.caching Yes.
+ *   Uses the last modification date of the xml document for validation
  * @cocoon.sitemap.component.pooling.max  32
  *
  * @version $Id$
  */
 public class HTMLGenerator extends ServiceableGenerator
-implements Configurable, CacheableProcessingComponent, Disposable {
+                           implements Configurable, CacheableProcessingComponent, Disposable {
 
     /** The parameter that specifies what request attribute to use, if any */
     public static final String FORM_NAME = "form-name";
@@ -79,25 +80,25 @@
     private InputStream requestStream;
 
     /** XPATH expression */
-    private String xpath = null;
+    private String xpath;
 
     /** XPath Processor */
-    private XPathProcessor processor = null;
+    private XPathProcessor processor;
 
     /** JTidy properties */
     private Properties properties;
 
+
     public void service(ServiceManager manager)
     throws ServiceException {
-        super.service( manager );
-        this.processor = (XPathProcessor)this.manager.lookup(XPathProcessor.ROLE);
+        super.service(manager);
+        this.processor = (XPathProcessor) this.manager.lookup(XPathProcessor.ROLE);
     }
 
     public void configure(Configuration config) throws ConfigurationException {
 
         String configUrl = config.getChild("jtidy-config").getValue(null);
-
-        if(configUrl != null) {
+        if (configUrl != null) {
             org.apache.excalibur.source.SourceResolver resolver = null;
             Source configSource = null;
             try {
@@ -128,7 +129,7 @@
      */
     public void recycle() {
         if (this.inputSource != null) {
-            this.resolver.release( this.inputSource );
+            this.resolver.release(this.inputSource);
             this.inputSource = null;
             this.requestStream = null;
         }
@@ -314,13 +315,12 @@
         }
     }
 
-
     public void dispose() {
-        if (this.manager != null) {
+        if (this.processor != null) {
             this.manager.release(this.processor);
-            this.manager = null;
+            this.processor = null;
         }
-        this.processor = null;
+        this.manager = null;
         super.dispose();
     }
 }

Modified: cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/NekoHTMLGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/NekoHTMLGenerator.java?rev=605591&r1=605590&r2=605591&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/NekoHTMLGenerator.java (original)
+++ cocoon/trunk/blocks/cocoon-html/cocoon-html-impl/src/main/java/org/apache/cocoon/generation/NekoHTMLGenerator.java Wed Dec 19 07:50:47 2007
@@ -55,21 +55,22 @@
 import org.xml.sax.SAXException;
 
 /**
+ * The Neko HTML generator reads HTML from a source, converts it to XHTML
+ * and generates SAX Events. It uses the NekoHTML library to do this.
+ *
  * @cocoon.sitemap.component.documentation
- * The neko html generator reads HTML from a source, converts it to XHTML
+ * The Neko HTML generator reads HTML from a source, converts it to XHTML
  * and generates SAX Events. It uses the NekoHTML library to do this.
- * 
  * @cocoon.sitemap.component.name   nekohtml
  * @cocoon.sitemap.component.label  content
- * @cocoon.sitemap.component.documentation.caching
- *               Uses the last modification date of the xml document for validation
- * 
+ * @cocoon.sitemap.component.documentation.caching Yes.
+ *   Uses the last modification date of the xml document for validation
  * @cocoon.sitemap.component.pooling.max  32
  *
  * @version $Id$
  */
 public class NekoHTMLGenerator extends ServiceableGenerator
-implements Configurable, CacheableProcessingComponent, Disposable {
+                               implements Configurable, CacheableProcessingComponent, Disposable {
 
     /** The parameter that specifies what request attribute to use, if any */
     public static final String FORM_NAME = "form-name";
@@ -81,25 +82,25 @@
     private InputStream requestStream;
 
     /** XPATH expression */
-    private String xpath = null;
+    private String xpath;
 
     /** XPath Processor */
-    private XPathProcessor processor = null;
+    private XPathProcessor processor;
 
     /** Neko properties */
     private Properties properties;
 
+    
     public void service(ServiceManager manager)
     throws ServiceException {
-        super.service( manager );
-        this.processor = (XPathProcessor)this.manager.lookup(XPathProcessor.ROLE);
+        super.service(manager);
+        this.processor = (XPathProcessor) this.manager.lookup(XPathProcessor.ROLE);
     }
 
     public void configure(Configuration config) throws ConfigurationException {
 
         String configUrl = config.getChild("neko-config").getValue(null);
-
-        if(configUrl != null) {
+        if (configUrl != null) {
             org.apache.excalibur.source.SourceResolver resolver = null;
             Source configSource = null;
             try {
@@ -130,7 +131,7 @@
      */
     public void recycle() {
         if (this.inputSource != null) {
-            this.resolver.release( this.inputSource );
+            this.resolver.release(this.inputSource);
             this.inputSource = null;
             this.requestStream = null;
         }
@@ -289,13 +290,12 @@
         }
     }
 
-
     public void dispose() {
-        if (this.manager != null) {
+        if (this.processor != null) {
             this.manager.release(this.processor);
-            this.manager = null;
+            this.processor = null;
         }
-        this.processor = null;
+        this.manager = null;
         super.dispose();
     }
 
@@ -309,7 +309,7 @@
             HTMLConfiguration config = new HTMLConfiguration();
             config.setProperty("http://cyberneko.org/html/properties/names/elems", "lower");
             if (properties != null) {
-                for (Iterator i = properties.keySet().iterator();i.hasNext();) {
+                for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
                     String name = (String) i.next();
                     if (name.indexOf("/features/") > -1) {
                         config.setFeature(name, Boolean.getBoolean(properties.getProperty(name)));
@@ -318,6 +318,7 @@
                     }
                 }
             }
+
             return config;
         }
     }