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).


Variable Index

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

Constructor Index

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

Method Index

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

Variables

 o LOAD
 public static final int LOAD
We will load the source file into the source string.

 o 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.

 o PARSE_STRING
 public static final int PARSE_STRING
We will parse the source string.

 o PARSE_FILE
 public static final int PARSE_FILE
We will parse the source file directly, without loading it into the source string.

Constructors

 o 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
 o 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

Methods

 o run
 public void run()
Load the file and/or execute the parse (depending on mode).

Overrides:
run in class xm_Thread
 o 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