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

    Modifier and Type
    Method
    Description
    <T> T
    as(Class<T> clazz)
    Try to get a instance of target class for this query agent, the target class is usually a OperationAgent or a native Component
    if it cannot get a instance of target class, it will throw AgentException.
    <T> boolean
    is(Class<T> clazz)
    Can get a instance of target class for this query agent.
    query(String selector)
    to find the first component agent with the selector in this query agent.
    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 Details

    • 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 a OperationAgent or a native Component
      if it cannot get a instance of target class, it will throw AgentException.
      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