Methods Summary |
---|
public synchronized void | addPropertyChangeListener(java.beans.PropertyChangeListener l)Add a property change listener.
if (_support == null)
{
synchronized(this)
{
// new test under synchronized block
if (_support == null)
_support = new PropertyChangeSupport(this);
}
}
_support.addPropertyChangeListener(l);
|
public synchronized void | addVetoableChangeListener(java.beans.VetoableChangeListener l)Add a vetoable change listener.
if (_vetoableSupport == null)
_vetoableSupport = new VetoableChangeSupport(this);
_vetoableSupport.addVetoableChangeListener(l);
|
public int | compareTo(java.lang.Object o)Compares this object with the specified object for order. Returns a negative integer, zero,
or a positive integer as this object is less than, equal to, or greater than the specified object.
The specified object must be mapping element, meaning it must be an instance of class
MappingElementImpl or any subclass. If not a ClassCastException is thrown.
The order of MappingElementImpl objects is defined by the order of their names.
Mapping elements without name are considered to be less than any named mapping element.
// null is not allowed
if (o == null)
throw new ClassCastException();
if (o == this)
return 0;
String thisName = getName();
// the following statement throws a ClassCastException if o is not a MappingElementImpl
String otherName = ((MappingElementImpl)o).getName();
// if this does not have a name it should compare less than any named object
if (thisName == null)
return (otherName == null) ? 0 : -1;
// if this is named and o does not have a name it should compare greater
if (otherName == null)
return 1;
// now we know that this and o are named mapping elements =>
// use locale-sensitive String comparison
int ret = Collator.getInstance().compare(thisName, otherName);
// if both names are equal, both objects might have different types.
// If so order both objects by their type names (necessary to be consistent with equals)
if ((ret == 0) && (getClass() != o.getClass()))
ret = getClass().getName().compareTo(o.getClass().getName());
return ret;
|
public boolean | equals(java.lang.Object obj)Overrides Object's equals method by comparing the name of this mapping element
with the name of the argument obj. The method returns false if obj does not have
the same dynamic type as this mapping element.
if (obj == null)
return false;
if (obj == this)
return true;
// check for the right class and then do the name check by calling compareTo.
return (getClass() == obj.getClass()) && (compareTo(obj) == 0);
|
protected void | firePropertyChange(java.lang.String name, java.lang.Object o, java.lang.Object n)Fires property change event.
if (_support != null)
_support.firePropertyChange(name, o, n);
|
protected void | fireVetoableChange(java.lang.String name, java.lang.Object o, java.lang.Object n)Fires vetoable change event.
if (_vetoableSupport != null)
_vetoableSupport.fireVetoableChange(name, o, n);
|
protected static final java.util.ResourceBundle | getMessages() return _messages;
|
public java.lang.String | getName()Get the name of this mapping element. return _name;
|
public int | hashCode()Overrides Object's hashCode method to return the hashCode of this mapping element's name.
return (getName()==null) ? 0 : getName().hashCode();
|
public void | removePropertyChangeListener(java.beans.PropertyChangeListener l)Remove a property change listener.
if (_support != null)
_support.removePropertyChangeListener(l);
|
public synchronized void | removeVetoableChangeListener(java.beans.VetoableChangeListener l)Remove a vetoable change listener.
if (_vetoableSupport != null)
_vetoableSupport.removeVetoableChangeListener(l);
|
public void | setName(java.lang.String name)Set the name of this mapping element.
String old = getName();
try
{
fireVetoableChange(PROP_NAME, old, name);
_name = name;
firePropertyChange(PROP_NAME, old, name);
}
catch (PropertyVetoException e)
{
throw new ModelVetoException(e);
}
|
public java.lang.String | toString()Overrides Object's toString method to return the name
of this mapping element. return getName();
|