org.eclipse.emf.validation.xml
Class XmlConstraintProvider

java.lang.Object
  extended byorg.eclipse.emf.validation.service.AbstractConstraintProvider
      extended byorg.eclipse.emf.validation.xml.XmlConstraintProvider
All Implemented Interfaces:
org.eclipse.core.runtime.IExecutableExtension, IModelConstraintProvider

public class XmlConstraintProvider
extends AbstractConstraintProvider
implements org.eclipse.core.runtime.IExecutableExtension

A convenient implementation of the IModelConstraintProvider interface which loads constraints from a plug-in's manifest XML.

Constraints may be specified in the plugin.xml file or in separate XML files containing the <constraints> element as their root and included from the plug-in manifest via a <include> element. Includes can nest to any depth.

Constraints may be specified in any language for which some plug-in provides an implementation via the constraintParsers extension point. Currently, the "Java" language is provided by the core EMF Model Validation plug-in.

This class is intended to be used by clients by reference in the constraintProviders extension point. It is not intended to be subclassed or otherwise used by client code.


Constructor Summary
XmlConstraintProvider()
           
 
Method Summary
 java.util.Collection getBatchConstraints(org.eclipse.emf.ecore.EObject eObject, java.util.Collection constraints)
          This is a no-op implementation.
protected  java.util.List getConstraints()
          Obtains my constraint proxies which lazily initialize the actual constraint implementations.
 java.util.Collection getLiveConstraints(org.eclipse.emf.common.notify.Notification notification, java.util.Collection constraints)
          This is a no-op implementation.
 void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config, java.lang.String propertyName, java.lang.Object data)
          Extends the inherited method to configure myself with my meta-data of one or more constraints.
 
Methods inherited from class org.eclipse.emf.validation.service.AbstractConstraintProvider
getNamespaceUris
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlConstraintProvider

public XmlConstraintProvider()
Method Detail

setInitializationData

public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config,
                                  java.lang.String propertyName,
                                  java.lang.Object data)
                           throws org.eclipse.core.runtime.CoreException
Extends the inherited method to configure myself with my meta-data of one or more constraints.

Specified by:
setInitializationData in interface org.eclipse.core.runtime.IExecutableExtension
Overrides:
setInitializationData in class AbstractConstraintProvider
Throws:
org.eclipse.core.runtime.CoreException - if the superclass implementation of this method throws or on an error in accessing the config

getLiveConstraints

public java.util.Collection getLiveConstraints(org.eclipse.emf.common.notify.Notification notification,
                                               java.util.Collection constraints)
Description copied from class: AbstractConstraintProvider
This is a no-op implementation. Subclasses that need to implement it should redefine this method. There is no need to call super.

Specified by:
getLiveConstraints in interface IModelConstraintProvider
Overrides:
getLiveConstraints in class AbstractConstraintProvider

getBatchConstraints

public java.util.Collection getBatchConstraints(org.eclipse.emf.ecore.EObject eObject,
                                                java.util.Collection constraints)
Description copied from class: AbstractConstraintProvider
This is a no-op implementation. Subclasses that need to implement it should redefine this method. There is no need to call super.

Specified by:
getBatchConstraints in interface IModelConstraintProvider
Overrides:
getBatchConstraints in class AbstractConstraintProvider

getConstraints

protected java.util.List getConstraints()
Obtains my constraint proxies which lazily initialize the actual constraint implementations.

Returns:
a list of constraint proxies

Copyright 2002, 2006 IBM Corporation and others.
All Rights Reserved.