Interface IJavaMonitor

All Superinterfaces:
IJavaElement, IJavaExpression, IJavaStatement

@Ser public interface IJavaMonitor extends IJavaStatement
Java AST interface to represent a special "monitor" statement. It can be one of two types:
  • __monitor_enter(lock)
  • __monitor_exit(lock)

Such statements are not legal Java constructs. Combined with try-finally blocks, they are used to represent very high-level constructs known as synchronized blocks.

  • Method Details

    • isEnter

      boolean isEnter()
      Determine if the monitor is a __monitor_enter statement.
      Returns:
      true if "enter", false if "exit"
    • isExit

      boolean isExit()
      Determine if the monitor is a __monitor_exit statement.
      Returns:
    • setEnter

      void setEnter(boolean enter)
    • getLock

      IJavaExpression getLock()
      Retrieve the lock object.
      Returns:
      the lock object, never null
    • setLock

      void setLock(IJavaExpression lock)
    • duplicate

      IJavaMonitor duplicate()
      Description copied from interface: IJavaElement
      Duplicate this element.
      Specified by:
      duplicate in interface IJavaElement
      Specified by:
      duplicate in interface IJavaExpression
      Specified by:
      duplicate in interface IJavaStatement
      Returns:
      a (possibly) duplicated object of the same type