org.eclipse.ocl.examples.pivot.validation
Class LoadableConstraintProvider
java.lang.Object
org.eclipse.emf.validation.service.AbstractConstraintProvider
org.eclipse.emf.validation.xml.XmlConstraintProvider
org.eclipse.ocl.examples.pivot.validation.LoadableConstraintProvider
- All Implemented Interfaces:
- org.eclipse.core.runtime.IExecutableExtension, org.eclipse.emf.validation.service.IModelConstraintProvider
- Direct Known Subclasses:
- CompleteOCLConstraintProvider, UMLProfileConstraintProvider
public abstract class LoadableConstraintProvider
- extends org.eclipse.emf.validation.xml.XmlConstraintProvider
LoadableConstraintProvider supports loading of algorithmically derived
constraints before a traversal of a particular nsURI starts.
Pending improvement of the EMFv API:
Two ConstraintProviders should be specified for the one Category for the
org.eclipse.emf.validation.constraintProviders extension point.
The first ConstraintProvider default-classed XmlConstraintProvider may have a
single placeholder constraint that provides the initial content of the
Model Validation Constraints Preference page.
The second ConstraintProvider deriving from LoadableConstraintProvider
should have a Path-languaged constraint with an XML path parameter locating the
model source of the loadable constraints. These will be loaded by the first validation
run and repopulate the Preference page with their content.
See org.eclipse.ocl.examples.xtext.tests/plugin.xml for an example.
Derived implementations such as UMLProfileConstraintProvider should implement load
to load the modeled constraints.
Method Summary |
static OCL |
getOCL()
|
protected void |
installConstraint(Constraint constraint,
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
|
protected void |
installContents(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> eContents,
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
|
protected void |
installDescriptor(org.eclipse.emf.validation.internal.util.XmlConstraintDescriptor descriptor,
java.lang.String namespaceIdentifier,
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
|
protected boolean |
installResource(org.eclipse.emf.ecore.resource.Resource asResource,
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
|
protected abstract boolean |
load(MetaModelManager metaModelManager,
org.eclipse.emf.common.util.URI uri,
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
|
void |
setInitializationData(org.eclipse.core.runtime.IConfigurationElement config,
java.lang.String propertyName,
java.lang.Object data)
|
java.lang.String |
toString()
|
Methods inherited from class org.eclipse.emf.validation.service.AbstractConstraintProvider |
createModelConstraint, createModelConstraintProxy, getBatchConstraints, getConstraints, getLiveConstraints, getNamespaceUris, registerConstraints |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LoadableConstraintProvider
protected LoadableConstraintProvider()
getOCL
@NonNull
public static OCL getOCL()
installConstraint
protected void installConstraint(@NonNull
Constraint constraint,
@NonNull
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
installContents
protected void installContents(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> eContents,
@NonNull
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
installDescriptor
protected void installDescriptor(@NonNull
org.eclipse.emf.validation.internal.util.XmlConstraintDescriptor descriptor,
java.lang.String namespaceIdentifier,
@NonNull
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
installResource
protected boolean installResource(@NonNull
org.eclipse.emf.ecore.resource.Resource asResource,
@NonNull
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
load
protected abstract boolean load(@NonNull
MetaModelManager metaModelManager,
@NonNull
org.eclipse.emf.common.util.URI uri,
@NonNull
java.util.Set<org.eclipse.emf.validation.model.Category> categories)
setInitializationData
public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config,
java.lang.String propertyName,
java.lang.Object data)
throws org.eclipse.core.runtime.CoreException
- Specified by:
setInitializationData
in interface org.eclipse.core.runtime.IExecutableExtension
- Overrides:
setInitializationData
in class org.eclipse.emf.validation.xml.XmlConstraintProvider
- Throws:
org.eclipse.core.runtime.CoreException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object