You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by we...@apache.org on 2002/08/20 07:02:51 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly TagSupport.java

werken      2002/08/19 22:02:51

  Modified:    jelly/src/java/org/apache/commons/jelly TagSupport.java
  Log:
  Adding parameterized version of getBodyText() to allow for explicitly
  setting escape/unescape mode.  Should we actually inherit from.. where?
  
  Revision  Changes    Path
  1.17      +20 -5     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TagSupport.java	26 Jun 2002 09:43:31 -0000	1.16
  +++ TagSupport.java	20 Aug 2002 05:02:51 -0000	1.17
  @@ -212,6 +212,21 @@
           return writer.toString();
       }
   
  +    /**
  +     * Evaluates the given body using a buffer and returns the String 
  +     * of the result.
  +     *
  +     * @param shouldEscape Signal if the text should be escaped.
  +     *
  +     * @return the text evaluation of the body
  +     */
  +    protected String getBodyText(boolean shouldEscape) throws Exception {
  +        StringWriter writer = new StringWriter();
  +        invokeBody(XMLOutput.createXMLOutput(writer,shouldEscape));
  +        return writer.toString();
  +    }
  +
  +
       /** 
        * Find all text nodes inside the top level of this body and 
        * if they are just whitespace then remove them
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>