org.eclipse.emf.validation.service
Class ConstraintFactory

java.lang.Object
  extended byorg.eclipse.emf.validation.service.ConstraintFactory

public abstract class ConstraintFactory
extends java.lang.Object

A constraint factory creates constraint implementations from descriptors. The intent is to support registration of custom factory implementations, but currently, the only implementation is the XmlConstraintFactory.

This class is not intended to be used outside of the validation framework.


Constructor Summary
protected ConstraintFactory()
          Initializes me.
 
Method Summary
protected abstract  IModelConstraint createConstraint(IXmlConstraintDescriptor descriptor)
          Implemented by subclasses to do the hard work of creating a constraint.
static ConstraintFactory getInstance()
          Obtains the currently registered factory instance.
 IModelConstraint newConstraint(IXmlConstraintDescriptor descriptor)
          Creates the constraint represented by the specified descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintFactory

protected ConstraintFactory()
Initializes me.

Method Detail

getInstance

public static ConstraintFactory getInstance()
Obtains the currently registered factory instance.

Returns:
the constraint factory instance

newConstraint

public final IModelConstraint newConstraint(IXmlConstraintDescriptor descriptor)
Creates the constraint represented by the specified descriptor. This method never fails to return a valid constraint implementation (though it may be a proxy for a disabled constraint if the descriptor is invalid). This method delegates to the superclass implementation of the ConstraintFactory.createConstraint(org.eclipse.emf.validation.xml.IXmlConstraintDescriptor) method.

Parameters:
descriptor - the constraint descriptor
Returns:
the corresponding constraint implementation
See Also:
ConstraintFactory.createConstraint(org.eclipse.emf.validation.xml.IXmlConstraintDescriptor)

createConstraint

protected abstract IModelConstraint createConstraint(IXmlConstraintDescriptor descriptor)
Implemented by subclasses to do the hard work of creating a constraint.

Parameters:
descriptor - a descriptor of the constraint to be created
Returns:
the appropriate implementation of the constraint

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