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
- 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
ConstructorsConstructorDescriptionCreate new MappingElementImpl with no corresponding name.MappingElementImpl(String name) Creates new MappingElementImpl with the corresponding name -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a property change listener.voidAdd a vetoable change listener.intCompares this object with the specified object for order.booleanOverrides 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 final ResourceBundlegetName()Get the name of this mapping element.inthashCode()Overrides Object'shashCodemethod to return the hashCode of this mapping element's name.voidRemove a property change listener.voidRemove a vetoable change listener.voidSet the name of this mapping element.toString()Overrides Object'stoStringmethod to return the name of this mapping element.
-
Constructor Details
-
MappingElementImpl
public MappingElementImpl()Create new MappingElementImpl with no corresponding name. This constructor should only be used for cloning and archiving. -
MappingElementImpl
Creates new MappingElementImpl with the corresponding name- Parameters:
name- the name of the element
-
-
Method Details
-
getMessages
- Returns:
- I18N message handler for this element
-
toString
Overrides Object'stoStringmethod to return the name of this mapping element. -
equals
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
Fires property change event.- Parameters:
name- property nameo- old valuen- new value
-
fireVetoableChange
Fires vetoable change event.- Parameters:
name- property nameo- old valuen- new value- Throws:
PropertyVetoException- when the change is vetoed by a listener
-
addPropertyChangeListener
Add a property change listener.- Specified by:
addPropertyChangeListenerin interfaceMappingElement- Parameters:
l- the listener to add
-
removePropertyChangeListener
Remove a property change listener.- Specified by:
removePropertyChangeListenerin interfaceMappingElement- Parameters:
l- the listener to remove
-
addVetoableChangeListener
Add a vetoable change listener.- Specified by:
addVetoableChangeListenerin interfaceMappingElement- Parameters:
l- the listener to add
-
removeVetoableChangeListener
Remove a vetoable change listener.- Specified by:
removeVetoableChangeListenerin interfaceMappingElement- Parameters:
l- the listener to remove
-
getName
Get the name of this mapping element.- Specified by:
getNamein interfaceMappingElement- Returns:
- the name
-
setName
Set the name of this mapping element.- Specified by:
setNamein interfaceMappingElement- Parameters:
name- the name- Throws:
ModelException- if impossible
-
compareTo
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
-