You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/06/26 11:43:31 UTC
cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly Tag.java TagSupport.java
jstrachan 2002/06/26 02:43:31
Modified: jelly/src/java/org/apache/commons/jelly Tag.java
TagSupport.java
Log:
Patched the use of invokeBody() so it actually works now ;-). Also thanks to these changes the
setTrim(false) now works on any Jelly tag.
<forEach trim="false" ...>
no whitespace trimming here....
</forEach>
Revision Changes Path
1.8 +30 -13 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/Tag.java
Index: Tag.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/Tag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Tag.java 14 Jun 2002 10:24:14 -0000 1.7
+++ Tag.java 26 Jun 2002 09:43:31 -0000 1.8
@@ -70,27 +70,44 @@
public interface Tag {
- /** @return the parent of this tag */
+ /**
+ * @return the parent of this tag
+ */
public Tag getParent();
- /** Sets the parent of this tag */
+ /**
+ * Sets the parent of this tag
+ */
public void setParent(Tag parent);
- /** @return the body of the tag */
-
+ /**
+ * @return the body of the tag
+ */
public Script getBody();
- /** Sets the body of the tag */
+ /**
+ * Sets the body of the tag
+ */
public void setBody(Script body);
- /** Gets the context in which the tag will be run */
+ /**
+ * Gets the context in which the tag will be run
+ */
public JellyContext getContext();
- /** Sets the context in which the tag will be run */
+ /**
+ * Sets the context in which the tag will be run
+ */
public void setContext(JellyContext context) throws Exception;
- /** Evaluates this tag after all the tags properties have been initialized.
+ /**
+ * Evaluates this tag after all the tags properties have been initialized.
*/
public void doTag(XMLOutput output) throws Exception;
+ /**
+ * A helper method to invoke this tags body
+ */
+ public void invokeBody(XMLOutput output) throws Exception;
+
}
1.16 +15 -15 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/TagSupport.java
Index: TagSupport.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/TagSupport.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- TagSupport.java 26 Jun 2002 09:24:36 -0000 1.15
+++ TagSupport.java 26 Jun 2002 09:43:31 -0000 1.16
@@ -178,6 +178,16 @@
/** Sets the context in which the tag will be run */
public void setContext(JellyContext context) throws Exception {
this.context = context;
+ }
+
+ /**
+ * Invokes the body of this tag using the given output
+ */
+ public void invokeBody(XMLOutput output) throws Exception {
+ if ( isTrim() && ! hasTrimmed ) {
+ trimBody();
+ }
+ getBody().run(context, output);
}
// Implementation methods
@@ -200,16 +210,6 @@
StringWriter writer = new StringWriter();
invokeBody(XMLOutput.createXMLOutput(writer));
return writer.toString();
- }
-
- /**
- * Invokes the body of this tag using the given output
- */
- protected void invokeBody(XMLOutput output) throws Exception {
- if ( isTrim() && ! hasTrimmed ) {
- trimBody();
- }
- invokeBody(output);
}
/**
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>