com.sun.jdo.api.persistence.model.jdo.impl
Class PersistenceElementImpl

java.lang.Object
  extended by 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
PersistenceElementImpl()
          Create new PersistenceElementImpl with no corresponding name.
PersistenceElementImpl(String name)
          Creates new PersistenceElementImpl with the corresponding name
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Add a property change listener.
 void addVetoableChangeListener(VetoableChangeListener l)
          Add a vetoable change listener.
 void attachToElement(PersistenceElement element)
          Called to attach the implementation to a specific element.
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.
 String getName()
          Get the name of this persistence element.
 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 persistence element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
attachToElement in interface PersistenceElement.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 name
o - old value
n - new value

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener.

Specified by:
addPropertyChangeListener in interface PersistenceElement.Impl
Parameters:
l - the listener to add

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.

Specified by:
removePropertyChangeListener in interface PersistenceElement.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 name
o - old value
n - 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:
addVetoableChangeListener in interface PersistenceElement.Impl
Parameters:
l - the listener to add

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener l)
Remove a vetoable change listener.

Specified by:
removeVetoableChangeListener in interface PersistenceElement.Impl
Parameters:
l - the listener to remove

getName

public String getName()
Get the name of this persistence element.

Specified by:
getName in interface PersistenceElement.Impl
Returns:
the name

setName

public void setName(String name)
             throws ModelException
Set the name of this persistence element.

Specified by:
setName in interface PersistenceElement.Impl
Parameters:
name - the name
Throws:
ModelException - if impossible


Copyright © 2012 GlassFish Community. All Rights Reserved.