org.apache.commons.jelly.tags.core
Class SwitchTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by org.apache.commons.jelly.tags.core.SwitchTag
All Implemented Interfaces:
Tag

public class SwitchTag
extends TagSupport

Executes the child <case> tag whose value equals my on attribute. Executes a child <default> tag when present and no <case> tag has yet matched.

Version:
$Revision: 1807798 $ $Date: 2017-09-08 14:43:34 -0400 (Fri, 08 Sep 2017) $
Author:
Rodney Waldhoff
See Also:
CaseTag, DefaultTag

Field Summary
private  boolean defaultEncountered
           
private  boolean fallingThru
           
private  Expression on
           
private  boolean someCaseMatched
           
private  java.lang.Object value
           
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
SwitchTag()
           
 
Method Summary
protected  void caseMatched()
           
protected  void defaultEncountered()
           
 void doTag(XMLOutput output)
          Evaluates this tag after all the tags properties have been initialized.
protected  java.lang.Object getValue()
           
protected  boolean hasDefaultBeenEncountered()
           
protected  boolean hasSomeCaseMatched()
           
protected  boolean isFallingThru()
           
protected  void setFallingThru(boolean fallingThru)
           
 void setOn(Expression on)
          Sets the value to switch on.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

someCaseMatched

private boolean someCaseMatched

fallingThru

private boolean fallingThru

defaultEncountered

private boolean defaultEncountered

on

private Expression on

value

private java.lang.Object value
Constructor Detail

SwitchTag

public SwitchTag()
Method Detail

setOn

public void setOn(Expression on)
Sets the value to switch on. Note that the Expression is evaluated only once, when the <switch> tag is evaluated.

Parameters:
on - the value to switch on

doTag

public void doTag(XMLOutput output)
           throws MissingAttributeException,
                  JellyTagException
Description copied from interface: Tag
Evaluates this tag after all the tags properties have been initialized.

Throws:
MissingAttributeException
JellyTagException

hasSomeCaseMatched

protected boolean hasSomeCaseMatched()

caseMatched

protected void caseMatched()

isFallingThru

protected boolean isFallingThru()

setFallingThru

protected void setFallingThru(boolean fallingThru)

getValue

protected java.lang.Object getValue()

hasDefaultBeenEncountered

protected boolean hasDefaultBeenEncountered()

defaultEncountered

protected void defaultEncountered()