public class AuResponse
extends java.lang.Object
UiEngine
.
Application developers rarely need access this class and its derived
directly.
Rather, use Clients
instead.
If you prefer to use the derives directly, you can use them with
Execution.addAuResponse(org.zkoss.zk.au.AuResponse)
.
Modifier and Type | Class and Description |
---|---|
protected static class |
AuResponse.JSONComponent |
protected static class |
AuResponse.JSONDate |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_cmd |
protected java.lang.Object[] |
_data
Either String or DeferredValue.
|
static int |
SC_ACTIVATION_TIMEOUT
ZK-Error (5502) indicating the request is aborted, because it
is waiting too long for the completion of the previous request.
|
static int |
SC_OUT_OF_SEQUENCE
ZK-Error (5501) indicating the request is out-of-sequence.
|
Constructor and Description |
---|
AuResponse(java.lang.String cmd)
Constructs a component-independent response.
|
AuResponse(java.lang.String cmd,
Component depends,
java.lang.Object data)
Constructs a response with one or zero data.
|
AuResponse(java.lang.String cmd,
Component depends,
java.lang.Object[] data)
Constructs a response with multiple data.
|
AuResponse(java.lang.String cmd,
java.lang.Object data)
Constructs a component-independent response.
|
AuResponse(java.lang.String cmd,
java.lang.Object[] data)
Constructs a component-independent response.
|
AuResponse(java.lang.String cmd,
Page depends,
java.lang.Object data)
Constructs a response with single data.
|
AuResponse(java.lang.String cmd,
Page depends,
java.lang.Object[] data)
Constructs a response with multiple data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getCommand()
Returns the command of this response (never null).
|
java.lang.Object |
getDepends()
Returns the component or page that this response depends on.
|
java.util.List<java.lang.Object> |
getEncodedData()
Returns the evaluated result of the associated data of
this response (might be null).
|
java.lang.String |
getOverrideKey()
Returns the override key.
|
java.lang.Object[] |
getRawData()
Returns the associated data of this response in the original
format (might be null).
|
int |
hashCode() |
java.lang.String |
toString() |
public static final int SC_OUT_OF_SEQUENCE
public static final int SC_ACTIVATION_TIMEOUT
protected java.lang.String _cmd
protected java.lang.Object[] _data
public AuResponse(java.lang.String cmd)
public AuResponse(java.lang.String cmd, java.lang.Object data)
data
- the data. It can be null, String, Date,
and any kind of objects that
the client accepts (marshaled by JSON).public AuResponse(java.lang.String cmd, java.lang.Object[] data)
public AuResponse(java.lang.String cmd, Component depends, java.lang.Object data)
depends
- specifies whether this response depends on whether
the depends component.
If depends is not null, this response shall be purged if the depends
component is removed.
If null, this response is called component-independent, and
always sent to the client.
Note: info of the depends component doesn't send to the client. It is used only to optimize what responses to send.
data
- specifies the data to be sent. If null, no data at all.public AuResponse(java.lang.String cmd, Component depends, java.lang.Object[] data)
public AuResponse(java.lang.String cmd, Page depends, java.lang.Object data)
public AuResponse(java.lang.String cmd, Page depends, java.lang.Object[] data)
data
- an array of data (null to ignore).
Each element must be an instance of String, DeferredValue
or null.java.lang.IllegalArgumentException
- if an element of data
is neither String nor DeferredValue.public java.lang.String getCommand()
public java.util.List<java.lang.Object> getEncodedData()
Note: when this method is called, DeferredValue
will be evaluated. Thus, don't call it until the rendering phase.
If you want to access it other than the render phase,
use getRawData()
instead.
Note: it is a copy, so any modification to it won't affect the data of this response.
getRawData()
public java.lang.Object[] getRawData()
Note: it is a readonly array. Don't change its value.
getEncodedData()
public final java.lang.Object getDepends()
public java.lang.String getOverrideKey()
getDepends()
).
Default: return null. The derived class shall override this method if it prefers to send the last response in the same category.
Notice that if depends is null and the override key is not null, they are sharing a single namespace of an execution.
Notice that if AbstractComponent.response(String,AuResponse)
is called, this override key is ignored (and the first argument of
the invocation is used).
public int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.