Package com.nomagic.uml2.ext.jmi
Class ModelPropertyChangeListeners
- java.lang.Object
-
- com.nomagic.uml2.ext.jmi.ModelPropertyChangeListeners
-
public class ModelPropertyChangeListeners extends java.lang.Object
API For adding/removing notifying uml property change listeners.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ModelPropertyChangeListeners.ListenerContainer
class
ModelPropertyChangeListeners.ListenerContainerSet
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
ELEMENTS_LISTENERS_LOCK
private java.util.Map<java.beans.PropertyChangeListener,ModelPropertyChangeListeners.ListenerContainerSet>
listenerContainers
private java.util.Map<java.lang.String,java.util.Map<javax.jmi.reflect.RefObject,ModelPropertyChangeListeners.ListenerContainer>>
listeners
private static org.apache.logging.log4j.Logger
LOG
private QualifiedNameListener
qualifiedNameListener
private AbstractRepository
repository
-
Constructor Summary
Constructors Constructor Description ModelPropertyChangeListeners(AbstractRepository abstractRepository)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener, javax.jmi.reflect.RefObject attachTo, java.lang.String propertyName)
java.util.Collection<java.beans.PropertyChangeListener>
getAllListeners()
Gets all registered listenersprivate ModelPropertyChangeListeners.ListenerContainerSet
getListenerContainers(java.beans.PropertyChangeListener listener)
private QualifiedNameListener
getQualifiedNameListener()
(package private) AbstractRepository
getRepository()
Gets the repository which events the listener listens ofvoid
notifyListeners(java.beans.PropertyChangeEvent event)
private static void
notifyListeners(java.beans.PropertyChangeListener[] listeners, java.beans.PropertyChangeEvent event)
void
removeAllPropertyChangeListeners(javax.jmi.reflect.RefObject removeFrom)
void
removeListener(java.beans.PropertyChangeListener listener)
private void
removeListenerFromListenerContainer(java.beans.PropertyChangeListener listener, ModelPropertyChangeListeners.ListenerContainer container)
void
removePropertyChangeListener(java.beans.PropertyChangeListener listener, javax.jmi.reflect.RefObject removeFrom, java.lang.String propertyName)
-
-
-
Field Detail
-
LOG
private static final org.apache.logging.log4j.Logger LOG
-
ELEMENTS_LISTENERS_LOCK
private final java.lang.Object ELEMENTS_LISTENERS_LOCK
-
listeners
private final java.util.Map<java.lang.String,java.util.Map<javax.jmi.reflect.RefObject,ModelPropertyChangeListeners.ListenerContainer>> listeners
-
listenerContainers
private final java.util.Map<java.beans.PropertyChangeListener,ModelPropertyChangeListeners.ListenerContainerSet> listenerContainers
-
qualifiedNameListener
private QualifiedNameListener qualifiedNameListener
-
repository
private final AbstractRepository repository
-
-
Constructor Detail
-
ModelPropertyChangeListeners
ModelPropertyChangeListeners(AbstractRepository abstractRepository)
-
-
Method Detail
-
getRepository
AbstractRepository getRepository()
Gets the repository which events the listener listens of- Returns:
- the repository
-
notifyListeners
public void notifyListeners(java.beans.PropertyChangeEvent event)
-
notifyListeners
private static void notifyListeners(java.beans.PropertyChangeListener[] listeners, java.beans.PropertyChangeEvent event)
-
getAllListeners
public java.util.Collection<java.beans.PropertyChangeListener> getAllListeners()
Gets all registered listeners- Returns:
- collection of registered listeners
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener, @CheckForNull javax.jmi.reflect.RefObject attachTo, @CheckForNull java.lang.String propertyName)
-
getListenerContainers
private ModelPropertyChangeListeners.ListenerContainerSet getListenerContainers(java.beans.PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener, @CheckForNull javax.jmi.reflect.RefObject removeFrom, @CheckForNull java.lang.String propertyName)
- Parameters:
listener
- listenerremoveFrom
- element which events listener do not want to listen. In case null remove listeners all events from repositorypropertyName
- name of the property
-
removeAllPropertyChangeListeners
public void removeAllPropertyChangeListeners(javax.jmi.reflect.RefObject removeFrom)
-
removeListenerFromListenerContainer
private void removeListenerFromListenerContainer(java.beans.PropertyChangeListener listener, ModelPropertyChangeListeners.ListenerContainer container)
-
removeListener
public void removeListener(java.beans.PropertyChangeListener listener)
-
getQualifiedNameListener
private QualifiedNameListener getQualifiedNameListener()
-
-