Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 69628 invoked from network); 12 Jun 2002 20:38:44 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jun 2002 20:38:44 -0000 Received: (qmail 9840 invoked by uid 97); 12 Jun 2002 20:38:49 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 9824 invoked by uid 97); 12 Jun 2002 20:38:49 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 9813 invoked by uid 97); 12 Jun 2002 20:38:48 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 12 Jun 2002 20:38:38 -0000 Message-ID: <20020612203838.21675.qmail@icarus.apache.org> From: werken@apache.org To: jakarta-commons-sandbox-cvs@apache.org Subject: cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core JellyTag.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N werken 2002/06/12 13:38:38 Modified: jelly/src/java/org/apache/commons/jelly/tags/core JellyTag.java Log: Somehow missed this. Compiler dumber than I thought. (else, maven/ant is) Revision Changes Path 1.7 +6 -53 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/JellyTag.java Index: JellyTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/JellyTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JellyTag.java 17 May 2002 15:18:08 -0000 1.6 +++ JellyTag.java 12 Jun 2002 20:38:37 -0000 1.7 @@ -87,22 +87,13 @@ /** The Log to which logging calls will be made. */ private static final Log log = LogFactory.getLog( JellyTag.class ); - /** whether whitespace should be trimmed or not. */ - private boolean trim = false; - - /** Whether we've trimmed or not */ - private boolean hasTrimmed; - public JellyTag() { } // Tag interface //------------------------------------------------------------------------- public void doTag(XMLOutput output) throws Exception { - if ( trim && ! hasTrimmed ) { - trimBody(); - hasTrimmed = true; - } + if ( log.isDebugEnabled() ) { log.debug( "Running body: " + getBody() ); } @@ -112,43 +103,5 @@ // Properties //------------------------------------------------------------------------- - /** Sets whether whitespace should be trimmed or not. */ - public void setTrim(boolean trim) { - this.trim = trim; - } - - public void setBody(Script body) { - super.setBody( body ); - hasTrimmed = false; - } - - // Implementation methods - //------------------------------------------------------------------------- - - /** - * Find all text nodes inside the top level of this body and - * if they are just whitespace then remove them - */ - protected void trimBody() throws Exception { - Script body = getBody(); - if ( body instanceof ScriptBlock ) { - ScriptBlock block = (ScriptBlock) body; - List list = block.getScriptList(); - for ( int i = list.size() - 1; i >= 0; i-- ) { - Script script = (Script) list.get(i); - if ( script instanceof TextScript ) { - TextScript textScript = (TextScript) script; - String text = textScript.getText(); - text = text.trim(); - if ( text.length() == 0 ) { - list.remove(i); - } - else { - textScript.setText(text); - } - } - } - } - } } -- To unsubscribe, e-mail: For additional commands, e-mail: