Class DefaultPageAgent

java.lang.Object
org.zkoss.zats.mimic.impl.DefaultPageAgent
All Implemented Interfaces:
Agent, PageAgent, QueryAgent

public class DefaultPageAgent extends Object implements PageAgent
Default implementation for PageAgent.
  • Constructor Details

    • DefaultPageAgent

      public DefaultPageAgent(DesktopAgent desktopAgent, org.zkoss.zk.ui.Page page)
  • Method Details

    • getId

      public String getId()
      Description copied from interface: PageAgent
      get ID. of the page.
      Specified by:
      getId in interface PageAgent
      Returns:
      ID or null if it hasn't.
    • getType

      public String getType()
    • getAttribute

      public Object getAttribute(String name)
      Description copied from interface: PageAgent
      get attribute by specify name.
      Specified by:
      getAttribute in interface PageAgent
      Parameters:
      name - attribute name.
      Returns:
      attribute value or null if not found or otherwise.
    • getUuid

      public String getUuid()
      Description copied from interface: PageAgent
      get UUID. of this the page.
      Specified by:
      getUuid in interface PageAgent
      Returns:
      UUID.
    • getRoots

      public List<ComponentAgent> getRoots()
      Description copied from interface: PageAgent
      get root component agents at the page.
      Specified by:
      getRoots in interface PageAgent
      Returns:
      a list contained root component agents.
    • getClient

      public Client getClient()
      Description copied from interface: Agent
      get client this agent belonged to.
      Specified by:
      getClient in interface Agent
    • getDesktop

      public DesktopAgent getDesktop()
      Description copied from interface: PageAgent
      get desktop of this page
      Specified by:
      getDesktop in interface PageAgent
    • getPage

      public org.zkoss.zk.ui.Page getPage()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getDelegatee

      public Object getDelegatee()
      Description copied from interface: Agent
      get the delegatee object
      Specified by:
      getDelegatee in interface Agent
    • query

      public ComponentAgent query(String selector)
      Description copied from interface: QueryAgent
      to find the first component agent with the selector in this query agent.
      Specified by:
      query in interface QueryAgent
      Parameters:
      selector - the selector
      Returns:
      the first component agent, null if not found
    • queryAll

      public List<ComponentAgent> queryAll(String selector)
      Description copied from interface: QueryAgent
      to find the component agents with the selector in this query agent.
      Specified by:
      queryAll in interface QueryAgent
      Parameters:
      selector - the selector
      Returns:
      the component agents
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • as

      public <T> T as(Class<T> clazz)
      Description copied from interface: QueryAgent
      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.
      Specified by:
      as in interface QueryAgent
      Parameters:
      clazz - class of specify operation.
      Returns:
      operation object.
    • is

      public <T> boolean is(Class<T> clazz)
      Description copied from interface: QueryAgent
      Can get a instance of target class for this query agent.
      Specified by:
      is in interface QueryAgent
      Parameters:
      clazz - the class cast to.
      Returns:
      true if can get a instance of target class