|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.data.AbstractNameable
public abstract class AbstractNameable
Convenience class implementing the Nameable interface.
You should derive all your Nameable classes from this class, as it provides a
complete implementation of the Nameable
interface. However, there is no
obligation to derive from this class, as long as your class implements Nameable and
sticks to the contract defined in that interface.
Field Summary | |
---|---|
protected NameContext |
m_ncContext
The current name context. |
private java.lang.Object |
m_oNCLock
The monitor synchronizing access to the NameContext. |
protected java.beans.PropertyChangeSupport |
m_pcsPropertyListeners
Used to fire PropertyChangeEvents . |
private java.lang.String |
m_sName
The name of this object. |
static java.lang.String |
SOME_PROPERTY
Indicates that one or more properties changed |
Fields inherited from interface org.salespointframework.core.data.interfaces.Nameable |
---|
NAME_PROPERTY |
Constructor Summary | |
---|---|
AbstractNameable()
Initialize a new AbstractNameable object with a null name. |
|
AbstractNameable(java.lang.String sName)
Initialize a new AbstractNameable object with the given name. |
Method Summary | |
---|---|
void |
addNameListener(java.beans.PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever the "name" property changes. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever a bound property changes. |
NameContext |
attach(NameContext nc)
Attach a NameContext to this Nameable. |
NameContext |
detachNC()
Detach the current NameContext from this Nameable. |
java.lang.String |
getName()
Get the name of the object. |
private java.lang.Object |
getNCLock()
Return the monitor synchronizing access to the NameContext. |
void |
removeNameListener(java.beans.PropertyChangeListener pcl)
Remove a PropertyChangeListener for the "name" property. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Remove a PropertyChangeListener. |
void |
setName(java.lang.String sName,
DataBasket db)
Set the Nameable's name, using help by the NameContext. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SOME_PROPERTY
protected java.beans.PropertyChangeSupport m_pcsPropertyListeners
PropertyChangeEvents
.
private java.lang.String m_sName
protected NameContext m_ncContext
private transient java.lang.Object m_oNCLock
Constructor Detail |
---|
public AbstractNameable()
null
name.
public AbstractNameable(java.lang.String sName)
null
.
sName
- the AbstractNameable's name.Method Detail |
---|
private final java.lang.Object getNCLock()
public NameContext attach(NameContext nc)
No naming conventions are checked neither in the old nor in the new NameContext.
All access to the NameContext is synchronized for thread-safety.
attach
in interface Nameable
nc
- the new NameContext of this Nameable object.
public NameContext detachNC()
All access to the NameContext is synchronized for thread-safety.
detachNC
in interface Nameable
public void setName(java.lang.String sName, DataBasket db) throws NameContextException
All access to the NameContext is synchronized for thread-safety.
setName
in interface Nameable
sName
- the new name of the objectdb
- the DataBasket relative to which the name change is to take place.
NameContextException
- if the name change was not approved of by the
NameContext.NameContext
public java.lang.String getName()
getName
in interface Nameable
public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
addPropertyChangeListener
in interface Nameable
public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
removePropertyChangeListener
in interface Nameable
public void addNameListener(java.beans.PropertyChangeListener pcl)
addNameListener
in interface Nameable
public void removeNameListener(java.beans.PropertyChangeListener pcl)
removeNameListener
in interface Nameable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |