4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.23 $ |
* @version $Revision: 1.24 $ |
* |
* Last modification: $Date: 2003/07/22 18:59:53 $ |
* $Id: ValidationErrorHandler.java,v 1.23 2003/07/22 18:59:53 smcsporr Exp $ |
* Last modification: $Date: 2003/07/24 14:20:18 $ |
* $Id: ValidationErrorHandler.java,v 1.24 2003/07/24 14:20:18 smcsporr Exp $ |
*/ |
|
package src.parser; |
24,26 → 24,32 |
/** |
* The <b><code>ValidationErrorHandler</code></b> class supplies an error handler for the |
* <code>Validator</code> class. |
* An error handler retrieves and handles error events sent by a SAX parser. These |
* errors include warnings, errors and fatal errors. |
* |
* @see org.apache.xml.utils.DefaultErrorHandler |
* |
* @author S. McSporran |
* |
* @version $Revision: 1.23 $ Last modification: $Date: 2003/07/22 18:59:53 $ |
* @version $Revision: 1.24 $ Last modification: $Date: 2003/07/24 14:20:18 $ |
*/ |
public class ValidationErrorHandler extends DefaultErrorHandler { |
|
/* Holds the information, if the parsed document is valid. */ |
/** Holds the information, if the parsed document is valid. */ |
private boolean valid = true; |
|
/* Reference variable to a log panel implementation. */ |
/** Reference variable to a log panel implementation. */ |
private LogInterface logInterfaceReference; |
|
/* Reference variable to a status panel implementation. */ |
/** Reference variable to a status panel implementation. */ |
private StatusInterface statusInterfaceReference; |
|
/** |
* This method sets the internal validation status to <code>true</code> or <code>false</code>. |
* This method resets the internal validation status to <code>true</code>. A document |
* is valid by default and it's validation status only changes to false, if an error or |
* fatal error occured. |
* The valid status can only be reset to <code>true</code> from external classes, so |
* only nonvalid XML documents will get a nonvalid status. |
* |
* @param value A <code>boolean</code> value. |
* |
52,20 → 58,22 |
* Last revision: 09-Jul-2003 |
*/ |
public void setValid(boolean value) { |
valid = value; |
if(value) { |
valid = value; |
} |
} |
|
/** |
* This method returns the current value of valid. |
* This method returns the status of the validation. |
* |
* @return The current valid status. |
* @return The validation status. Will be <code>true</code>, if no error or |
* fatal error occured during the validation process. |
* |
* author S. McSporran |
* author S. McSporran |
* |
* Last revision: 18-Jun-2003 |
*/ |
public boolean isValid() { |
|
return valid; |
} |
|
72,7 → 80,7 |
/** |
* A method that catches SAX warnings and sends them to the log panel. |
* Warnings indicate that something might be missing or incorrect in a XML file, |
* wile no XML wellformedness rule has been broken. |
* while no XML wellformedness rule has been broken. |
* |
* @param saxpe A warning sent by a SAX Parser. |
* |
161,12 → 169,12 |
statusInterfaceReference = stat; |
} |
|
/* Sends a message to the log panel. */ |
/** Sends a message to the log panel. */ |
private void log(int i, String message) { |
logInterfaceReference.log(i,message); |
} |
|
/* Sets a new point in the status panel. */ |
/** Sets a new point in the status panel. */ |
private void setNewPoint(Point p) { |
statusInterfaceReference.setPoint(p); |
} |