Package com.adobe.xfa

Class ScriptDebugger


  • public class ScriptDebugger
    extends java.lang.Object
    An ScriptDebugger provides script debugging access to an ScriptHandler.
    • Constructor Summary

      Constructors 
      Constructor Description
      ScriptDebugger()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void didExecuteScript​(int nScriptID, Arg oReturnValue)
      Signals that the specified script has finished executing.
      int getScriptID​(ScriptHandler oScriptHandler, java.lang.String sScriptContents, Node oContextNode, int eReason)
      Provide a unique script ID for the specified script, given its context information.
      int getScriptID​(ScriptHandler oScriptHandler, java.lang.String sScriptContents, java.lang.String sContextNodeSOM, int eReason)
      For remote debugging.
      void poll​(ScriptHandler oScriptHandler)
      The poll() method is periodically called during the execution of a script.
      void resolvedValue​(java.lang.String sValueName, Arg oRetrievedValue)
      Called to indicate that a script handler resolved a value internally.
      void stopped​(int nScriptID, int nLine)
      Signals that the specified script has stopped momentarily.
      void willExecuteScript​(int nScriptID)
      Signals that the specified script is about to execute.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScriptDebugger

        public ScriptDebugger()
    • Method Detail

      • getScriptID

        public int getScriptID​(ScriptHandler oScriptHandler,
                               java.lang.String sScriptContents,
                               Node oContextNode,
                               int eReason)
        Provide a unique script ID for the specified script, given its context information. It's up the the derived class to look up and possibly create an identifier. The value has no particular meaning to the debugging framework. Typically the derived class will maintain a table, and the ID is the index into that table.
        Parameters:
        oScriptHandler - the script handler of the script.
        sScriptContents - the executable code of the script.
        oContextNode - the Node that is the current node when the script runs.
        eReason - the reason for the execution of the script.
        Returns:
        the ID for the script.
      • getScriptID

        public int getScriptID​(ScriptHandler oScriptHandler,
                               java.lang.String sScriptContents,
                               java.lang.String sContextNodeSOM,
                               int eReason)
        For remote debugging. To support remote debugging (i.e. debugging an application in another executable) the derived class must override this method. It's identical to the other version of getScriptID except that the context node is provided as a SOM expression instead of as an Node.
      • willExecuteScript

        public void willExecuteScript​(int nScriptID)
        Signals that the specified script is about to execute. At this point the derived class can optionally display the script. If breakpoints have been set for this script ID, then the derived class must re-establish them by calling ScriptHandler::debugBreakPoint. The reason for this is that the script handler doesn't have the big picture -- it simply executes a script when told to do so.
        Parameters:
        nScriptID - the unique identifier of the script.
      • didExecuteScript

        public void didExecuteScript​(int nScriptID,
                                     Arg oReturnValue)
        Signals that the specified script has finished executing. The return value is provided. The derived class may choose to ignore this, or display the result to the user.
        Parameters:
        nScriptID - the unique identifier of the script.
        oReturnValue - the return value of the script.
      • stopped

        public void stopped​(int nScriptID,
                            int nLine)
        Signals that the specified script has stopped momentarily. Either a breakpoint or single-stepping through code can cause this. The derived class should display the script at the specified line.
        Parameters:
        nScriptID - the unique identifier of the script.
        nLine - the current execution line of the script.
      • resolvedValue

        public void resolvedValue​(java.lang.String sValueName,
                                  Arg oRetrievedValue)
        Called to indicate that a script handler resolved a value internally. The debugger can regard these as a form of trace message.
        Parameters:
        sValueName - the name of the value that was resolved.
        oRetrievedValue - the resultant value.
      • poll

        public void poll​(ScriptHandler oScriptHandler)
        The poll() method is periodically called during the execution of a script.
        Parameters:
        oScriptHandler - the script handler that is active.