|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.validation.service.ConstraintRegistry
public class ConstraintRegistry
A centralized registry of descriptors
for
the constraints that are available in the validation system. Clients can
use this registry to look up the meta-data for constraints (given the
constraint IDs), and constraint providers can register the constraints that
they provide in the registry.
Note for dynamic constraint providers: registering constraints in the registry is not absolutely necessary if none of the following capabilities of the system is required for your constraints:
Method Summary | |
---|---|
void |
addConstraintListener(IConstraintListener listener)
Adds an IConstraintListener to receive constraint change
events. |
void |
broadcastConstraintChangeEvent(ConstraintChangeEvent event)
Broadcasts the specified ConstraintChangeEvent to all
constraint listeners. |
Collection<IConstraintDescriptor> |
getAllDescriptors()
Obtains the descriptors for all registered constraints, in no particular order. |
IConstraintDescriptor |
getDescriptor(String id)
Obtains the unique constraint descriptor having the specified ID. |
IConstraintDescriptor |
getDescriptor(String pluginId,
String id)
Obtains the unique constraint descriptor having the specified ID. |
static ConstraintRegistry |
getInstance()
Obtains the instance of the constraint registry. |
void |
register(IConstraintDescriptor descriptor)
Registers a constraint descriptor. |
void |
removeConstraintListener(IConstraintListener listener)
Removes the IConstraintListener from the list of listeners. |
void |
unregister(IConstraintDescriptor descriptor)
Unregisters an existing constraint descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ConstraintRegistry getInstance()
public IConstraintDescriptor getDescriptor(String id)
id
- the ID of the constraint descriptor to retrieve
(not null
)
null
if it
does not existpublic IConstraintDescriptor getDescriptor(String pluginId, String id)
pluginId
- the ID of the plug-in that contributes the constraintid
- the constraint's ID, relative to the plug-in ID
null
if it
does not existpublic Collection<IConstraintDescriptor> getAllDescriptors()
public void register(IConstraintDescriptor descriptor) throws ConstraintExistsException
descriptor
- a new constraint descriptor, which must have a
unique ID (not null
)
ConstraintExistsException
- if a different descriptor is already
registered under the given descriptor
's IDpublic void unregister(IConstraintDescriptor descriptor)
descriptor
's ID will subsequently be available for
re-use.
descriptor
- a constraint descriptor (not null
)public void addConstraintListener(IConstraintListener listener)
IConstraintListener
to receive constraint change
events. This method has no effect if the IConstraintListener
is already registered.
listener
- a new constraint listenerpublic void removeConstraintListener(IConstraintListener listener)
IConstraintListener
from the list of listeners.
This method has no effect if the IConstraintListener
is not
currently registered.
listener
- a constraint listenerpublic void broadcastConstraintChangeEvent(ConstraintChangeEvent event)
ConstraintChangeEvent
to all
constraint listeners. This method is used internally by constraints
to send notifications when they have changed.
Note that this method should only be invoked by implementation of
of the IConstraintDescriptor
interface.
event
- a constraint change event to broadcast
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |