org.ceryle.ui
Class DocumentValidator
java.lang.Object
java.lang.Thread
org.ceryle.ui.DocumentValidator
- All Implemented Interfaces:
- Runnable
public class DocumentValidator
- extends Thread
Extends Thread to validate an XML Document, provided with a Swing
document. If verbose is true, indicates with progress bar and error
messages. If not, is silent (not even error messages).
This makes a first pass in validating mode if the Document has a
DOCTYPE declaration, then a second pass if that fails. If there is
no DOCTYPE, just a WF parse.
- Author:
- Murray Altheim
|
Method Summary |
Document |
getDocument()
|
Iterator |
getErrors()
Return null if no errors, otherwise an Iterator over the parse Exceptions. |
boolean |
isDone()
Returns true if the process is complete. |
boolean |
isOkay()
Returns true if the document was either well-formed or valid. |
boolean |
isValidating()
Returns true if the document was processed with a validating XML processor
(as opposed to a well-formed XML processor). |
void |
run()
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
DocumentValidator
public DocumentValidator(DocumentView docview,
Document doc,
boolean verbose)
throws ProcessException
- Constructor provided with the Document to check.
- Parameters:
docview - an optional parent DocumentViewdoc - the Swing Document containing the content to be checked as XMLverbose - the verbosity flag.
- Throws:
ProcessException
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
getDocument
public Document getDocument()
isDone
public boolean isDone()
- Returns true if the process is complete.
isValidating
public boolean isValidating()
- Returns true if the document was processed with a validating XML processor
(as opposed to a well-formed XML processor).
isOkay
public boolean isOkay()
- Returns true if the document was either well-formed or valid. I.e., it had no errors.
getErrors
public Iterator getErrors()
- Return null if no errors, otherwise an Iterator over the parse Exceptions.
The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.