Class MappingElementImpl
- java.lang.Object
-
- com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
-
- All Implemented Interfaces:
MappingElement,MappingElementProperties,Comparable
- Direct Known Subclasses:
MappingClassElementImpl,MappingMemberElementImpl
public abstract class MappingElementImpl extends Object implements MappingElement
- Version:
- %I%
- Author:
- raccah
-
-
Field Summary
-
Fields inherited from interface com.sun.jdo.api.persistence.model.mapping.MappingElementProperties
PROP_ASSOCIATED_COLUMNS, PROP_COLUMNS, PROP_CONSISTENCY, PROP_DATABASE_ROOT, PROP_FETCH_GROUP, PROP_FIELDS, PROP_IN_CONCURRENCY_CHECK, PROP_KEY_COLUMNS, PROP_MODIFIED, PROP_NAME, PROP_NAVIGABLE, PROP_READ_ONLY, PROP_REFERENCING_KEYS, PROP_TABLE, PROP_TABLES, PROP_VERSION_FIELD
-
-
Constructor Summary
Constructors Constructor Description MappingElementImpl()Create new MappingElementImpl with no corresponding name.MappingElementImpl(String name)Creates new MappingElementImpl with the corresponding name
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener l)Add a property change listener.voidaddVetoableChangeListener(VetoableChangeListener l)Add a vetoable change listener.intcompareTo(Object o)Compares this object with the specified object for order.booleanequals(Object obj)Overrides Object'sequalsmethod by comparing the name of this mapping element with the name of the argument obj.protected voidfirePropertyChange(String name, Object o, Object n)Fires property change event.protected voidfireVetoableChange(String name, Object o, Object n)Fires vetoable change event.protected static ResourceBundlegetMessages()StringgetName()Get the name of this mapping element.inthashCode()Overrides Object'shashCodemethod to return the hashCode of this mapping element's name.voidremovePropertyChangeListener(PropertyChangeListener l)Remove a property change listener.voidremoveVetoableChangeListener(VetoableChangeListener l)Remove a vetoable change listener.voidsetName(String name)Set the name of this mapping element.StringtoString()Overrides Object'stoStringmethod to return the name of this mapping element.
-
-
-
Constructor Detail
-
MappingElementImpl
public MappingElementImpl()
Create new MappingElementImpl with no corresponding name. This constructor should only be used for cloning and archiving.
-
MappingElementImpl
public MappingElementImpl(String name)
Creates new MappingElementImpl with the corresponding name- Parameters:
name- the name of the element
-
-
Method Detail
-
getMessages
protected static final ResourceBundle getMessages()
- Returns:
- I18N message handler for this element
-
toString
public String toString()
Overrides Object'stoStringmethod to return the name of this mapping element.
-
equals
public boolean equals(Object obj)
Overrides Object'sequalsmethod by comparing the name of this mapping element with the name of the argument obj. The method returnsfalseif obj does not have the same dynamic type as this mapping element.
-
hashCode
public int hashCode()
Overrides Object'shashCodemethod to return the hashCode of this mapping element's name.
-
firePropertyChange
protected void firePropertyChange(String name, Object o, Object n)
Fires property change event.- Parameters:
name- property nameo- old valuen- new value
-
fireVetoableChange
protected void fireVetoableChange(String name, Object o, Object n) throws PropertyVetoException
Fires vetoable change event.- Parameters:
name- property nameo- old valuen- new value- Throws:
PropertyVetoException- when the change is vetoed by a listener
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener.- Specified by:
addPropertyChangeListenerin interfaceMappingElement- Parameters:
l- the listener to add
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.- Specified by:
removePropertyChangeListenerin interfaceMappingElement- Parameters:
l- the listener to remove
-
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener l)
Add a vetoable change listener.- Specified by:
addVetoableChangeListenerin interfaceMappingElement- Parameters:
l- the listener to add
-
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener l)
Remove a vetoable change listener.- Specified by:
removeVetoableChangeListenerin interfaceMappingElement- Parameters:
l- the listener to remove
-
getName
public String getName()
Get the name of this mapping element.- Specified by:
getNamein interfaceMappingElement- Returns:
- the name
-
setName
public void setName(String name) throws ModelException
Set the name of this mapping element.- Specified by:
setNamein interfaceMappingElement- Parameters:
name- the name- Throws:
ModelException- if impossible
-
compareTo
public int compareTo(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.- Specified by:
compareToin interfaceComparable- Parameters:
o- the Object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- - if the specified object is null or is not an instance of MappingElementImpl
-
-