XML Constraint Definition Parsers

org.eclipse.emf.validation.constraintParsers

1.0

This extension point allows plug-ins to register objects which know how to parse constraints encoded in a particular language from an XML document.

<!ELEMENT extension (constraintParser+)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT constraintParser EMPTY>

<!ATTLIST constraintParser

lang  CDATA #REQUIRED

class CDATA #REQUIRED>

Defines an XML constraint parser.



To provide support for constraints defined in scripted Java embedded in the constraint provider XML, using BeanShell, one might define an extension like the following:

     

<extension point=

"org.eclipse.emf.validation.constraintParsers"

>

<constraintParser class=

"com.example.validation.BeanShellConstraintParser"

lang=

"Java-BeanShell"

>

</constraintParser>

</extension>

The value of the <constraintParser> element class attribute must be the fully qualified name of a class that implements the org.eclipse.emf.validation.xml.IXmlConstraintParser interface. It is instantiated using the default (no-argument) constructor; only a single instance is created by the system.

The org.eclipse.emf.validation.ocl plug-in provides support for OCL as a constraint language using a constraint parser.