    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class xm.xm_ParseThread

    java.lang.Object
       |
       +----java.lang.Thread
               |
               +----xm.xm_Thread
                       |
                       +----xm.xm_ParseThread

public class xm_ParseThread
extends xm_Thread

Thread to load an XML source from a file and/or parse an XML source. The reason the loading and parsing are in the same class is to allow both to be performed one after the other (which would be complicated if they were not in the same thread).

##

LOAD
  We will load the source file into the source string.
LOAD_AND_PARSE_STRING
  We will load the source file into the source string and then parse it.
PARSE_FILE
  We will parse the source file directly, without loading it into the source string.
PARSE_STRING
  We will parse the source string.

##

xm_ParseThread(int, String, xm_DocumentModel, JTextArea)
  Constructor.
xm_ParseThread(xm_DocumentModel, JTextArea)
  Constructor, omitting file pathname.

##

run()
  Load the file and/or execute the parse (depending on mode).
setThreadMode(int)
  Set this thread's mode, which defines which actions it will take.

##

LOAD

     public static final int LOAD

  We will load the source file into the source string.

LOAD_AND_PARSE_STRING

     public static final int LOAD_AND_PARSE_STRING

  We will load the source file into the source string and then parse it.

PARSE_STRING

     public static final int PARSE_STRING

  We will parse the source string.

PARSE_FILE

     public static final int PARSE_FILE

  We will parse the source file directly, without loading it into the source string.

##

xm_ParseThread

     public xm_ParseThread(int InputThreadMode,
                           String InputSourcePathname,
                           xm_DocumentModel InputDocumentModel,
                           JTextArea InputSourceTextArea)

  Constructor.

  Parameters:
    InputThreadMode - Defines what actions we wish to take
    InputSourcePathname - Name of file to load
    InputDocumentModel - Model holding document to be parsed
    InputSourceTextArea - Source text area, to highlight errors

xm_ParseThread

     public xm_ParseThread(xm_DocumentModel InputDocumentModel,
                           JTextArea InputSourceTextArea)

  Constructor, omitting file pathname. Without the pathname, the only allowed mode is PARSE_STRING - so that's what we set the mode to.

  Parameters:
    InputDocumentModel - Model holding document to be parsed
    InputSourceTextArea - Source text area, to highlight errors

##

run

     public void run()

  Load the file and/or execute the parse (depending on mode).

  Overrides:
    run in class xm_Thread

setThreadMode

     public void setThreadMode(int InputMode)

  Set this thread's mode, which defines which actions it will take.

  Parameters:
    InputMode - The new mode

    All Packages  Class Hierarchy  This Package  Previous  Next  Index