1 16 package org.apache.commons.jelly.tags.core; 17 18 import org.apache.commons.jelly.JellyTagException; 19 import org.apache.commons.jelly.TagSupport; 20 import org.apache.commons.jelly.XMLOutput; 21 22 27 public class OtherwiseTag extends TagSupport { 28 29 public OtherwiseTag() { 30 } 31 32 public void doTag(XMLOutput output) throws JellyTagException { 35 ChooseTag tag = (ChooseTag) findAncestorWithClass( ChooseTag.class ); 36 if ( tag == null ) { 37 throw new JellyTagException( "This tag must be enclosed inside a <choose> tag" ); 38 } 39 if ( ! tag.isBlockEvaluated() ) { 40 tag.setBlockEvaluated(true); 41 invokeBody(output); 42 } 43 } 44 } 45 | Popular Tags |