Class PersistenceElement
java.lang.Object
com.sun.jdo.api.persistence.model.jdo.PersistenceElement
- All Implemented Interfaces:
PersistenceElementProperties,Comparable
- Direct Known Subclasses:
PersistenceClassElement,PersistenceMemberElement
public abstract class PersistenceElement
extends Object
implements PersistenceElementProperties, Comparable
- Version:
- %I%
- Author:
- raccah
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePluggable implementation of the storage of element properties. -
Field Summary
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElementProperties
PROP_CARDINALITY, PROP_COLLECTION_CLASS, PROP_DELETE_ACTION, PROP_ELEMENT_CLASS, PROP_FIELDS, PROP_GROUPS, PROP_IDENTITY, PROP_INVERSE_FIELD, PROP_KEY_CLASS, PROP_KEY_FIELD, PROP_MODIFIED, PROP_NAME, PROP_PERSISTENCE, PROP_PREFETCH, PROP_SENSITIVITY, PROP_UPDATE_ACTION -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate new PersistenceElement with no implementation.protectedCreate new PersistenceElement with the provided implementation. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdd a property change listener.final voidAdd a vetoable change listener.intCompares this object with the specified object for order.booleanOverrides Object'sequalsmethod by comparing the name of this persistence element with the name of the argument obj.final PersistenceElement.ImplgetImpl()protected static final ResourceBundlegetName()Get the name of this persistence element.inthashCode()Overrides Object'shashCodemethod to return the hashCode of this persistence element's name.final voidRemove a property change listener.final voidRemove a vetoable change listener.voidSet the implementation factory of this persistence element.voidSet the name of this persistence element.toString()Overrides Object'stoStringmethod to return the name of this persistence element.
-
Constructor Details
-
PersistenceElement
public PersistenceElement()Create new PersistenceElement with no implementation. This constructor should only be used for cloning and archiving. -
PersistenceElement
Create new PersistenceElement with the provided implementation. The implementation is responsible for storing all properties of the object.- Parameters:
impl- the implementation to use
-
-
Method Details
-
getImpl
- Returns:
- implemetation factory for this element
-
getMessages
- Returns:
- I18N message handler for this element
-
addPropertyChangeListener
Add a property change listener.- Parameters:
l- the listener to add- See Also:
-
removePropertyChangeListener
Remove a property change listener.- Parameters:
l- the listener to remove- See Also:
-
addVetoableChangeListener
Add a vetoable change listener.- Parameters:
l- the listener to add- See Also:
-
removeVetoableChangeListener
Remove a vetoable change listener.- Parameters:
l- the listener to remove- See Also:
-
getName
Get the name of this persistence element.- Returns:
- the name
-
setName
Set the name of this persistence element.- Parameters:
name- the name- Throws:
ModelException- if impossible
-
toString
Overrides Object'stoStringmethod to return the name of this persistence element. -
equals
Overrides Object'sequalsmethod by comparing the name of this persistence element with the name of the argument obj. The method returnsfalseif obj does not have the same dynamic type as this persistence element. -
hashCode
public int hashCode()Overrides Object'shashCodemethod to return the hashCode of this persistence element's name. -
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 persistence element, meaning it must be an instance of class PersistenceElement or any subclass. If not a ClassCastException is thrown. The order of PersistenceElement objects is defined by the order of their names. Persistence elements without name are considered to be less than any named persistence 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 PersistenceElement
-
setImpl
Set the implementation factory of this persistence element. This method should only be used internally and for cloning and archiving.- Parameters:
impl- the implementation to use
-