|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.au.Command
public abstract class Command
Represents a command of a request (AuRequest).
Each command is unique no matter getId() is the same or not.
There are two kind of commands: global commands and component-specific
commands. A global command is stored in a global map (as soon as it is
instantiated), and it can be retrieved by invoking AuRequest.getCommand(String).
A component-specific command is maintained by a component, and
can be retrieved by use of ComponentCtrl.getCommand(java.lang.String).
A global command is extended from Command.
Since it is global, you have to instantiate
an instance at startup. A typical usage is to declare a static instance
of a class.
A component-specific command is extended from ComponentCommand.
It is not part of the global map, and it is used only if it is returned
by ComponentCtrl.getCommand(java.lang.String).
| Field Summary | |
|---|---|
static int |
CTRL_GROUP
Whether this command belongs to the control group. |
static int |
IGNORABLE
Whether this command is ignorable. |
static int |
IGNORE_IMMEDIATE_OLD_EQUIV
Whether to drop the existent command (in the queue) if it is the same as the immediate following one. |
static int |
IGNORE_OLD_EQUIV
Whether to drop the existent command (in the queue) if it is the same as the new arrival one. |
static int |
SKIP_IF_EVER_ERROR
Whether to skip this command if previous commands ever caused errors. |
| Constructor Summary | |
|---|---|
protected |
Command(java.lang.String id,
int flags)
Construct a command. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
int |
getFlags()
Returns the attributes of this command, a combination of SKIP_IF_EVER_ERROR, IGNORABLE and others. |
java.lang.String |
getId()
Returns ID of this command. |
protected abstract void |
process(AuRequest request)
Derived must override this method to process this command. |
void |
process(AuRequest request,
boolean everError)
Called to process the specified request. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SKIP_IF_EVER_ERROR
process(AuRequest,boolean) is called with errorEver = true;
This argument is used to control the behavior of
process(AuRequest,boolean).
Part of the returned value of getFlags().
public static final int IGNORABLE
Part of the returned value of getFlags().
public static final int CTRL_GROUP
public static final int IGNORE_OLD_EQUIV
public static final int IGNORE_IMMEDIATE_OLD_EQUIV
| Constructor Detail |
|---|
protected Command(java.lang.String id,
int flags)
Note: once constructed, the command is registered to a global
map automatically. And, it can be retrieved by
AuRequest.getCommand(java.lang.String).
flags - a combination of SKIP_IF_EVER_ERROR,
IGNORABLE and others| Method Detail |
|---|
public final int getFlags()
SKIP_IF_EVER_ERROR, IGNORABLE and others.
public final java.lang.String getId()
public final java.lang.String toString()
toString in class java.lang.Objectpublic final boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected abstract void process(AuRequest request)
public final void process(AuRequest request,
boolean everError)
process(AuRequest).
everError - whether any error ever occured before
processing this command.
Notice that multiple commands might be processed in one
execution.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||