You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2004/12/08 04:31:08 UTC

svn commit: r111201 - /incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java /incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java

Author: ekoneil
Date: Tue Dec  7 19:31:07 2004
New Revision: 111201

URL: http://svn.apache.org/viewcvs?view=rev&rev=111201
Log:
Tweaks to the RenderAppender code.

- add asserts to trap null StringBuilders in the StringBuilderRenderAppender
- add Apache 2.0 license comments to both
- fix the name of the "setStringBuilder" method on the StringBuilderRenderAppender

BB: self
DRT: NetUI pass


Modified:
   incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java
   incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java

Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java?view=diff&rev=111201&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java&r1=111200&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java&r2=111201
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java	(original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/AbstractRenderAppender.java	Tue Dec  7 19:31:07 2004
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
 package org.apache.beehive.netui.tags.rendering;
 
 /**

Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java?view=diff&rev=111201&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java&r1=111200&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java&r2=111201
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java	(original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/StringBuilderRenderAppender.java	Tue Dec  7 19:31:07 2004
@@ -1,19 +1,29 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
 package org.apache.beehive.netui.tags.rendering;
 
-import org.apache.beehive.netui.util.logging.Logger;
-
 /**
- * Created by IntelliJ IDEA.
- * User: dolander
- * Date: Nov 3, 2004
- * Time: 7:45:09 PM
- * To change this template use File | Settings | File Templates.
+ * This is an implementation of {@link AbstractRenderAppender} which appends
+ * Strings to a {@link java.lang.StringBuilder}
  */
 public class StringBuilderRenderAppender
-        extends AbstractRenderAppender
+    extends AbstractRenderAppender
 {
-    private static final Logger logger = Logger.getInstance(WriteRenderAppender.class);
-
     private StringBuilder _sb;
 
     public StringBuilderRenderAppender()
@@ -25,18 +35,20 @@
         _sb = sb;
     }
 
-    public void setPageContext(StringBuilder sb)
+    public void setStringBuilder(StringBuilder sb)
     {
         _sb = sb;
     }
 
     public void append(String s)
     {
+        assert _sb != null : "Render appender doesn't have a valid string builder";
         _sb.append(s);
     }
 
     public void append(char c)
     {
+        assert _sb != null : "Render appender doesn't have a valid string builder";
         _sb.append(c);
     }
 }