Class ModelValidator
- java.lang.Object
-
- de.unirostock.sems.bives.algorithm.ModelValidator
-
public abstract class ModelValidator extends Object
The abstract class ModelValidator will serve as parent for ML validators. This might also be a good way to parse documents.- Author:
- Martin Scharm
-
-
Constructor Summary
Constructors Constructor Description ModelValidator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ModelDocument
getDocument()
Gets the parsed document if it was valid, of null otherwise.Exception
getError()
Gets the error the was thrown in case of an invalid document.abstract boolean
validate(de.unirostock.sems.xmlutils.ds.TreeDocument d)
Validate a document.abstract boolean
validate(File d)
Validate a document represented as a file.abstract boolean
validate(String d)
Validate a document represented as a string.boolean
validate(URL url)
Validate a document downladable from a web server.
-
-
-
Field Detail
-
error
protected Exception error
The error.
-
-
Method Detail
-
validate
public abstract boolean validate(de.unirostock.sems.xmlutils.ds.TreeDocument d)
Validate a document.- Parameters:
d
- the document- Returns:
- true, if document is a valid model
-
validate
public abstract boolean validate(File d)
Validate a document represented as a file.- Parameters:
d
- the file storing a document- Returns:
- true, if submitted string is a valid model
-
validate
public abstract boolean validate(String d)
Validate a document represented as a string.- Parameters:
d
- the textual representation of a document- Returns:
- true, if submitted string is a valid model
-
getDocument
public abstract ModelDocument getDocument()
Gets the parsed document if it was valid, of null otherwise. Since we need to create a document anyways, here you can get it for free ;-)- Returns:
- the document
-
getError
public Exception getError()
Gets the error the was thrown in case of an invalid document.- Returns:
- the error
-
validate
public boolean validate(URL url)
Validate a document downladable from a web server.- Parameters:
url
- the URL to the webserver- Returns:
- true, if submitted string is a valid model
-
-