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 void
addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener.void
addVetoableChangeListener(VetoableChangeListener l)
Add a vetoable change listener.int
compareTo(Object o)
Compares this object with the specified object for order.boolean
equals(Object obj)
Overrides Object'sequals
method by comparing the name of this mapping element with the name of the argument obj.protected void
firePropertyChange(String name, Object o, Object n)
Fires property change event.protected void
fireVetoableChange(String name, Object o, Object n)
Fires vetoable change event.protected static ResourceBundle
getMessages()
String
getName()
Get the name of this mapping element.int
hashCode()
Overrides Object'shashCode
method to return the hashCode of this mapping element's name.void
removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.void
removeVetoableChangeListener(VetoableChangeListener l)
Remove a vetoable change listener.void
setName(String name)
Set the name of this mapping element.String
toString()
Overrides Object'stoString
method 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'stoString
method to return the name of this mapping element.
-
equals
public boolean equals(Object obj)
Overrides Object'sequals
method by comparing the name of this mapping element with the name of the argument obj. The method returnsfalse
if obj does not have the same dynamic type as this mapping element.
-
hashCode
public int hashCode()
Overrides Object'shashCode
method 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:
addPropertyChangeListener
in interfaceMappingElement
- Parameters:
l
- the listener to add
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.- Specified by:
removePropertyChangeListener
in interfaceMappingElement
- Parameters:
l
- the listener to remove
-
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener l)
Add a vetoable change listener.- Specified by:
addVetoableChangeListener
in interfaceMappingElement
- Parameters:
l
- the listener to add
-
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener l)
Remove a vetoable change listener.- Specified by:
removeVetoableChangeListener
in interfaceMappingElement
- Parameters:
l
- the listener to remove
-
getName
public String getName()
Get the name of this mapping element.- Specified by:
getName
in interfaceMappingElement
- Returns:
- the name
-
setName
public void setName(String name) throws ModelException
Set the name of this mapping element.- Specified by:
setName
in 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:
compareTo
in 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
-
-