Class MappingMemberElementImpl

java.lang.Object
com.sun.jdo.api.persistence.model.mapping.impl.MappingElementImpl
com.sun.jdo.api.persistence.model.mapping.impl.MappingMemberElementImpl
All Implemented Interfaces:
MappingElement, MappingElementProperties, MappingMemberElement, Comparable
Direct Known Subclasses:
MappingFieldElementImpl, MappingReferenceKeyElementImpl, MappingTableElementImpl

public abstract class MappingMemberElementImpl extends MappingElementImpl implements MappingMemberElement
Version:
%I%
Author:
Mark Munro, Rochelle Raccah
  • Constructor Details

    • MappingMemberElementImpl

      public MappingMemberElementImpl()
      Create new MappingMemberElementImpl with no corresponding name or declaring class. This constructor should only be used for cloning and archiving.
    • MappingMemberElementImpl

      public MappingMemberElementImpl(String name, MappingClassElement declaringClass)
      Create new MappingMemberElementImpl with the corresponding name and declaring class.
      Parameters:
      name - the name of the element
      declaringClass - the class to attach to
  • Method Details

    • getDeclaringClass

      public MappingClassElement getDeclaringClass()
      Get the declaring class.
      Specified by:
      getDeclaringClass in interface MappingMemberElement
      Returns:
      the class that owns this member element, or null if the element is not attached to any class
    • equals

      public boolean equals(Object obj)
      Overrides MappingElementImpl's equals method to add comparison of the name of the declaring class this mapping element. The method returns false if obj does not have a declaring class with the same name as this mapping element.
      Overrides:
      equals in class MappingElementImpl
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Overrides MappingElementImpl's hashCode method to add the hashCode of this mapping element's declaring class.
      Overrides:
      hashCode in class MappingElementImpl
      Returns:
      a hash code value for this object.
    • firePropertyChange

      protected final void firePropertyChange(String name, Object o, Object n)
      Fires property change event. This method overrides that of MappingElementImpl to update the MappingClassElementImpl's modified status.
      Overrides:
      firePropertyChange in class MappingElementImpl
      Parameters:
      name - property name
      o - old value
      n - new value
    • fireVetoableChange

      protected final void fireVetoableChange(String name, Object o, Object n) throws PropertyVetoException
      Fires vetoable change event. This method overrides that of MappingElementImpl to give listeners a chance to block changes on the mapping class element modified status.
      Overrides:
      fireVetoableChange in class MappingElementImpl
      Parameters:
      name - property name
      o - old value
      n - new value
      Throws:
      PropertyVetoException - when the change is vetoed by a listener
    • setDeclaringClass

      public void setDeclaringClass(MappingClassElement declaringClass)
      Set the declaring class of this mapping member. This method should only be used internally and for cloning and archiving.
      Parameters:
      declaringClass - the declaring class of this mapping member