1 16 package org.apache.commons.jelly.impl; 17 18 import java.util.List ; 19 20 import org.apache.commons.jelly.Script; 21 22 23 31 public class CompositeTextScriptBlock extends ScriptBlock { 32 33 36 public CompositeTextScriptBlock() { 37 } 38 39 40 45 public void trimWhitespace() { 46 List list = getScriptList(); 47 int size = list.size(); 48 if ( size > 0 ) { 49 Script script = (Script) list.get(0); 50 if ( script instanceof TextScript ) { 51 TextScript textScript = (TextScript) script; 52 textScript.trimWhitespace(); 53 } 54 if ( size > 1 ) { 55 script = (Script) list.get(size - 1); 56 if ( script instanceof TextScript ) { 57 TextScript textScript = (TextScript) script; 58 textScript.trimWhitespace(); 59 } 60 } 61 } 62 } 63 64 65 } 66 | Popular Tags |