Class ValidationServiceDelegate

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidationServiceDelegate

        public ValidationServiceDelegate()
        Initializes me.
    • Method Detail

      • validate

        public Optional<org.eclipse.emf.common.util.Diagnostic> validate​(org.eclipse.core.resources.IFile file,
                                                                         org.eclipse.core.runtime.IProgressMonitor monitor)
        Description copied from interface: ValidationDelegate
        Validate a file in the workspace.
        Specified by:
        validate in interface ValidationDelegate
        Parameters:
        file - the file to validate
        monitor - for reporting validation progress
        Returns:
        the problems found, if any
      • loadModel

        protected org.eclipse.emf.ecore.resource.ResourceSet loadModel​(org.eclipse.core.resources.IFile file)
                                                                throws java.io.IOException
        Load a model into a resource set.
        Parameters:
        file - the model file to load
        Returns:
        the resource set into which it is loaded
        Throws:
        java.io.IOException - on failure to load the file
      • getModel

        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.
        Parameters:
        resourceSet - the loaded resource set
        Returns:
        the model object to validate, or null if there is none
        See Also:
        loadModel(IFile)
      • configure

        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.
        Parameters:
        validationService - the validation service to configure
        resourceSet - the resource set in which it will validate the model
        model - the model object to be validated
      • unload

        protected void unload​(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
        Unload the model after validation is complete.
        Parameters:
        resourceSet - the model to unload
        See Also:
        loadModel(IFile)