public class EvlValidator extends Object implements org.eclipse.emf.ecore.EValidator
Modifier and Type | Class and Description |
---|---|
static interface |
EvlValidator.ValidationProblemListener |
org.eclipse.emf.ecore.EValidator.Descriptor, org.eclipse.emf.ecore.EValidator.PatternMatcher, org.eclipse.emf.ecore.EValidator.Registry, org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider, org.eclipse.emf.ecore.EValidator.ValidationDelegate
Modifier and Type | Field and Description |
---|---|
protected String |
bundleId |
protected org.eclipse.emf.ecore.resource.Resource |
currentResource |
static String |
DEFAULT_MODEL_NAME |
protected Set<String> |
diagnosticVariables |
protected Collection<org.eclipse.emf.ecore.EPackage> |
ePackages
Collection of all packages that are available to this validator
|
protected String |
ePackageUri |
protected Collection<org.eclipse.emf.ecore.EObject> |
history |
protected boolean |
logErrors |
protected String |
modelName |
protected EvlModule |
module |
protected EmfPrettyPrinter |
printer |
protected List<EvlValidator.ValidationProblemListener> |
problemListeners |
protected ValidationResults |
results |
protected boolean |
showErrorDialog |
protected URI |
source |
static String |
VALIDATION_MONITOR
Key for the validation context, that (when provided) holds a
IProgressMonitor object
|
Constructor and Description |
---|
EvlValidator()
Note when using this constructor, make sure to call
initialise(URI, String, String, String) afterwards |
EvlValidator(URI source,
String modelName,
String ePackageUri,
String bundleId) |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalPackage(String packageUri)
Make an additional package available to be used by this validator.
|
void |
addDiagnosticianVariable(String name)
Indicates that the value of the entry of the
Diagnostician
context Map with the specified name should
be published as a global variable in the EVL script. |
protected void |
addMarkers(String msgPrefix,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.common.util.DiagnosticChain diagnostics) |
void |
addValidationProblemListener(EvlValidator.ValidationProblemListener listener) |
protected org.eclipse.emf.common.util.Diagnostic |
createDiagnostic(String msgPrefix,
UnsatisfiedConstraint unsatisfied) |
void |
initialise(URI source,
String modelName,
String ePackageUri,
String bundleId) |
boolean |
isLogErrors()
This method is used by the default implementation of
logException() |
boolean |
isShowErrorDialog() |
boolean |
logException(Exception exception)
Method to determine whether the given exception needs to be logged.
|
boolean |
removeValidationProblemListener(EvlValidator.ValidationProblemListener listener) |
void |
setLogErrors(boolean logErrors)
Sets whether errors need to be logged or not
|
void |
setShowErrorDialog(boolean showErrorDialog)
Sets whether an error dialog needs to be shown
|
boolean |
validate(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validate(org.eclipse.emf.ecore.EDataType dataType,
Object value,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
Map<Object,Object> context) |
boolean |
validate(org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
Map<Object,Object> context) |
protected void |
validate(org.eclipse.emf.ecore.resource.Resource resource,
Map<Object,Object> context) |
protected EvlModule module
protected URI source
protected EmfPrettyPrinter printer
protected org.eclipse.emf.ecore.resource.Resource currentResource
protected ValidationResults results
protected Collection<org.eclipse.emf.ecore.EObject> history
protected String modelName
protected String ePackageUri
protected String bundleId
protected boolean showErrorDialog
protected boolean logErrors
protected List<EvlValidator.ValidationProblemListener> problemListeners
protected Collection<org.eclipse.emf.ecore.EPackage> ePackages
public static final String DEFAULT_MODEL_NAME
public static final String VALIDATION_MONITOR
public EvlValidator()
initialise(URI, String, String, String)
afterwardspublic void initialise(URI source, String modelName, String ePackageUri, String bundleId)
public void addDiagnosticianVariable(String name)
Indicates that the value of the entry of the Diagnostician
context Map
with the specified name
should
be published as a global variable in the EVL script. If the context map
does not contain an entry with the specified name
, the variable
will be set to null
.
Note: this map is received through the validate
methods in this
class.
public void addAdditionalPackage(String packageUri)
packageUri
- Namespace URI of the packagepublic boolean validate(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.common.util.DiagnosticChain diagnostics, Map<Object,Object> context)
validate
in interface org.eclipse.emf.ecore.EValidator
public boolean validate(org.eclipse.emf.ecore.EClass eClass, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.common.util.DiagnosticChain diagnostics, Map<Object,Object> context)
validate
in interface org.eclipse.emf.ecore.EValidator
public boolean validate(org.eclipse.emf.ecore.EDataType dataType, Object value, org.eclipse.emf.common.util.DiagnosticChain diagnostics, Map<Object,Object> context)
validate
in interface org.eclipse.emf.ecore.EValidator
protected org.eclipse.emf.common.util.Diagnostic createDiagnostic(String msgPrefix, UnsatisfiedConstraint unsatisfied)
protected void validate(org.eclipse.emf.ecore.resource.Resource resource, Map<Object,Object> context)
protected void addMarkers(String msgPrefix, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.common.util.DiagnosticChain diagnostics)
public boolean isShowErrorDialog()
public void setShowErrorDialog(boolean showErrorDialog)
isShowErrorDialog()
public boolean logException(Exception exception)
public boolean isLogErrors()
logException()
logException(Exception)
public void setLogErrors(boolean logErrors)
isLogErrors()
public void addValidationProblemListener(EvlValidator.ValidationProblemListener listener)
public boolean removeValidationProblemListener(EvlValidator.ValidationProblemListener listener)
Copyright © 2016. All rights reserved.