Package org.zkoss.zats.mimic
Interface QueryAgent
-
- All Superinterfaces:
Agent
- All Known Subinterfaces:
ComponentAgent,DesktopAgent,PageAgent
- All Known Implementing Classes:
DefaultComponentAgent,DefaultDesktopAgent,DefaultPageAgent
public interface QueryAgent extends Agent
Agent that can be used to query other agent.- Since:
- 1.2.1
- Author:
- henrichen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Tas(Class<T> clazz)Try to get a instance of target class for this query agent, the target class is usually aOperationAgentor a nativeComponent
if it cannot get a instance of target class, it will throwAgentException.<T> booleanis(Class<T> clazz)Can get a instance of target class for this query agent.ComponentAgentquery(String selector)to find the first component agent with the selector in this query agent.List<ComponentAgent>queryAll(String selector)to find the component agents with the selector in this query agent.-
Methods inherited from interface org.zkoss.zats.mimic.Agent
getClient, getDelegatee
-
-
-
-
Method Detail
-
query
ComponentAgent query(String selector)
to find the first component agent with the selector in this query agent.- Parameters:
selector- the selector- Returns:
- the first component agent, null if not found
-
queryAll
List<ComponentAgent> queryAll(String selector)
to find the component agents with the selector in this query agent.- Parameters:
selector- the selector- Returns:
- the component agents
-
as
<T> T as(Class<T> clazz)
Try to get a instance of target class for this query agent, the target class is usually aOperationAgentor a nativeComponent
if it cannot get a instance of target class, it will throwAgentException.- Parameters:
clazz- class of specify operation.- Returns:
- operation object.
-
is
<T> boolean is(Class<T> clazz)
Can get a instance of target class for this query agent.- Parameters:
clazz- the class cast to.- Returns:
- true if can get a instance of target class
-
-