public class ValidationServiceDelegate extends Object implements ValidationDelegate
ValidationService
to validate a resource. This class may be used as is or it may be extended by
clients to customize any of
loading the model filefinding the model object to validateconfiguring the validation service
for the model's peculiar needsunloading the model to clean up any additional resourcesNULL| Constructor and Description |
|---|
ValidationServiceDelegate()
Initializes me.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure(ValidationService validationService,
org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.emf.ecore.EObject model)
Configure the validation service with constraint providers, filters, or whatever else
is necessary for complete and correct validation of the
model. |
protected org.eclipse.emf.ecore.EObject |
getModel(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Obtain the model object to be validated from the loaded resource set.
|
protected org.eclipse.emf.ecore.resource.ResourceSet |
loadModel(org.eclipse.core.resources.IFile file)
Load a model into a resource set.
|
protected void |
unload(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Unload the model after validation is complete.
|
Optional<org.eclipse.emf.common.util.Diagnostic> |
validate(org.eclipse.core.resources.IFile file,
org.eclipse.core.runtime.IProgressMonitor monitor)
Validate a
file in the workspace. |
public Optional<org.eclipse.emf.common.util.Diagnostic> validate(org.eclipse.core.resources.IFile file, org.eclipse.core.runtime.IProgressMonitor monitor)
ValidationDelegatefile in the workspace.validate in interface ValidationDelegatefile - the file to validatemonitor - for reporting validation progressprotected org.eclipse.emf.ecore.resource.ResourceSet loadModel(org.eclipse.core.resources.IFile file)
throws IOException
file - the model file to loadIOException - on failure to load the fileprotected org.eclipse.emf.ecore.EObject getModel(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet - the loaded resource setnull if there is noneloadModel(IFile)protected void configure(ValidationService validationService, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.ecore.EObject model)
model.validationService - the validation service to configureresourceSet - the resource set in which it will validate the modelmodel - the model object to be validatedprotected void unload(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet - the model to unloadloadModel(IFile)Copyright © 2020. All rights reserved.