Package org.zkoss.web.servlet.dsp.action
Class AbstractAction
java.lang.Object
org.zkoss.web.servlet.dsp.action.AbstractAction
- All Implemented Interfaces:
Action
- Direct Known Subclasses:
Box,Choose,ForEach,If,Img,Include,Otherwise,Out,Page,Remove,Set,When
A skeletal implementation to simplify the implementation of actions.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidappend(StringBuffer sb, String attrName, boolean avail) Appends an attribute to the string buffer, ifavailis true.protected static final voidappend(StringBuffer sb, String attrName, int val) Appends an attribute to the string buffer.protected static final voidappend(StringBuffer sb, String attrName, String attrValue) Appends an attribute to the string buffer, ifattrValueis not null.booleangetIf()Returns the if condition.booleanReturns the unless condition.booleanReturns whether this tag is effective.voidsetIf(boolean ifcond) Sets the if condition.voidsetUnless(boolean unless) Sets the unless condition.protected static final intReturns one ofActionContext.PAGE_SCOPE,ActionContext.REQUEST_SCOPE,ActionContext.SESSION_SCOPEandActionContext.APPLICATION_SCOPEof the specified scope name.
-
Constructor Details
-
AbstractAction
public AbstractAction()
-
-
Method Details
-
getIf
public boolean getIf()Returns the if condition. If the if condition is false, this tag is ignored. If the unless condition (getUnless()) is true, this tag is ignored, too. Tags deriving from this class shall invokeisEffective()to know the result.Default: true.
-
setIf
public void setIf(boolean ifcond) Sets the if condition. -
getUnless
public boolean getUnless()Returns the unless condition. If the unless condition is true, this tag is ignored. If the if condition (getIf()) is true, this tag is ignored, too. Tags deriving from this class shall invokeisEffective()to know the result.Default: false.
-
setUnless
public void setUnless(boolean unless) Sets the unless condition. -
isEffective
public boolean isEffective()Returns whether this tag is effective. If false, this tag does nothing (as if not specified at all). -
toScope
Returns one ofActionContext.PAGE_SCOPE,ActionContext.REQUEST_SCOPE,ActionContext.SESSION_SCOPEandActionContext.APPLICATION_SCOPEof the specified scope name.- Parameters:
scope- one of "page", "request", "session" and "application".
-
append
Appends an attribute to the string buffer, ifattrValueis not null. -
append
Appends an attribute to the string buffer, ifavailis true. -
append
Appends an attribute to the string buffer.
-