Class PersistenceElementImpl
- java.lang.Object
-
- com.sun.jdo.api.persistence.model.jdo.impl.PersistenceElementImpl
-
- All Implemented Interfaces:
PersistenceElement.Impl,PersistenceElementProperties
- Direct Known Subclasses:
PersistenceClassElementImpl,PersistenceMemberElementImpl
public abstract class PersistenceElementImpl extends Object implements PersistenceElement.Impl, PersistenceElementProperties
- Version:
- %I%
- Author:
- raccah
-
-
Field Summary
-
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
ADD, REMOVE, SET
-
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
Constructors Constructor Description PersistenceElementImpl()Create new PersistenceElementImpl with no corresponding name.PersistenceElementImpl(String name)Creates new PersistenceElementImpl with the corresponding name
-
Method Summary
All 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.voidattachToElement(PersistenceElement element)Called to attach the implementation to a specific element.protected voidfirePropertyChange(String name, Object o, Object n)Fires property change event.protected voidfireVetoableChange(String name, Object o, Object n)Fires vetoable change event.StringgetName()Get the name of this persistence element.voidremovePropertyChangeListener(PropertyChangeListener l)Remove a property change listener.voidremoveVetoableChangeListener(VetoableChangeListener l)Remove a vetoable change listener.voidsetName(String name)Set the name of this persistence element.
-
-
-
Constructor Detail
-
PersistenceElementImpl
public PersistenceElementImpl()
Create new PersistenceElementImpl with no corresponding name. This constructor should only be used for cloning and archiving.
-
PersistenceElementImpl
public PersistenceElementImpl(String name)
Creates new PersistenceElementImpl with the corresponding name- Parameters:
name- the name of the element
-
-
Method Detail
-
attachToElement
public void attachToElement(PersistenceElement element)
Called to attach the implementation to a specific element. Will be called in the element's constructor. Allows implementors of this interface to store a reference to the holder class, useful for implementing the property change listeners.- Specified by:
attachToElementin interfacePersistenceElement.Impl- Parameters:
element- the element to attach to
-
firePropertyChange
protected void firePropertyChange(String name, Object o, Object n)
Fires property change event.- Parameters:
name- property nameo- old valuen- new value
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener.- Specified by:
addPropertyChangeListenerin interfacePersistenceElement.Impl- Parameters:
l- the listener to add
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.- Specified by:
removePropertyChangeListenerin interfacePersistenceElement.Impl- Parameters:
l- the listener to remove
-
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
-
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener l)
Add a vetoable change listener.- Specified by:
addVetoableChangeListenerin interfacePersistenceElement.Impl- Parameters:
l- the listener to add
-
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener l)
Remove a vetoable change listener.- Specified by:
removeVetoableChangeListenerin interfacePersistenceElement.Impl- Parameters:
l- the listener to remove
-
getName
public String getName()
Get the name of this persistence element.- Specified by:
getNamein interfacePersistenceElement.Impl- Returns:
- the name
-
setName
public void setName(String name) throws ModelException
Set the name of this persistence element.- Specified by:
setNamein interfacePersistenceElement.Impl- Parameters:
name- the name- Throws:
ModelException- if impossible
-
-