Class ValidationService
- java.lang.Object
-
- org.eclipse.emf.ecp.common.spi.cachetree.AbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
-
- org.eclipse.emf.ecp.internal.validation.ValidationService
-
- All Implemented Interfaces:
IValidationService
public final class ValidationService extends AbstractCachedTree<org.eclipse.emf.common.util.Diagnostic> implements IValidationService
Implementation of a validation service.- Author:
- emueller, Tobias Verhoeven
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ValidationService.CachedSeverityTreeNode
Tree node that caches the severity of its children.
-
Constructor Summary
Constructors Constructor Description ValidationService(IExcludedObjectsCallback callback)
Constructor for the ECP ValidationService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachedTreeNode<org.eclipse.emf.common.util.Diagnostic>
createdCachedTreeNode(org.eclipse.emf.common.util.Diagnostic diagnostic)
Creates a cached tree node.org.eclipse.emf.common.util.Diagnostic
getDefaultValue()
Returns the default value for a cached node.
The root value will be initialized with this value, tooorg.eclipse.emf.common.util.Diagnostic
getDiagnostic(java.lang.Object eObject)
Returns the severity for the givenEObject
.org.eclipse.emf.common.util.Diagnostic
getRootDiagnostic()
Returns the highest severity.java.util.Set<org.eclipse.emf.ecore.EObject>
validate(java.util.Collection<org.eclipse.emf.ecore.EObject> eObjects)
Validates the givenEObject
s.java.util.Set<org.eclipse.emf.ecore.EObject>
validate(org.eclipse.emf.ecore.EObject eObject)
Validates the givenEObject
.-
Methods inherited from class org.eclipse.emf.ecp.common.spi.cachetree.AbstractCachedTree
clear, getCachedValue, getNodes, getRootValue, remove, update, updateNodeObject, updateParentNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecp.validation.api.IValidationService
remove
-
-
-
-
Constructor Detail
-
ValidationService
public ValidationService(IExcludedObjectsCallback callback)
Constructor for the ECP ValidationService.- Parameters:
callback
- to use
-
-
Method Detail
-
validate
public java.util.Set<org.eclipse.emf.ecore.EObject> validate(java.util.Collection<org.eclipse.emf.ecore.EObject> eObjects)
Validates the givenEObject
s.- Specified by:
validate
in interfaceIValidationService
- Parameters:
eObjects
- a collection ofEObject
s to be validated- Returns:
- the set of affected elements
-
validate
public java.util.Set<org.eclipse.emf.ecore.EObject> validate(org.eclipse.emf.ecore.EObject eObject)
Validates the givenEObject
.- Specified by:
validate
in interfaceIValidationService
- Parameters:
eObject
- theEObject
to be validated- Returns:
- the set of affected elements
-
getDiagnostic
public org.eclipse.emf.common.util.Diagnostic getDiagnostic(java.lang.Object eObject)
Returns the severity for the givenEObject
.- Specified by:
getDiagnostic
in interfaceIValidationService
- Parameters:
eObject
- theEObject
whose severity should be returned- Returns:
- the severity for the given
EObject
-
getRootDiagnostic
public org.eclipse.emf.common.util.Diagnostic getRootDiagnostic()
Returns the highest severity.- Specified by:
getRootDiagnostic
in interfaceIValidationService
- Returns:
- the highest severity
-
getDefaultValue
public org.eclipse.emf.common.util.Diagnostic getDefaultValue()
Returns the default value for a cached node.
The root value will be initialized with this value, too- Specified by:
getDefaultValue
in classAbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
- Returns:
- the default value for a cached tree node
-
createdCachedTreeNode
public CachedTreeNode<org.eclipse.emf.common.util.Diagnostic> createdCachedTreeNode(org.eclipse.emf.common.util.Diagnostic diagnostic)
Creates a cached tree node.- Specified by:
createdCachedTreeNode
in classAbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
- Parameters:
diagnostic
- the value stored by the cached tree node- Returns:
- the created node
-
-