1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.mail;
  6. /**
  7. * This class models a Part that is contained within a Multipart.
  8. * This is an abstract class. Subclasses provide actual implementations.<p>
  9. *
  10. * BodyPart implements the Part interface. Thus, it contains a set of
  11. * attributes and a "content".
  12. *
  13. * @author John Mani
  14. * @author Bill Shannon
  15. */
  16. public abstract class BodyPart implements Part {
  17. /**
  18. * The <code>Multipart</code> object containing this <code>BodyPart</code>,
  19. * if known.
  20. * @since JavaMail 1.1
  21. */
  22. protected Multipart parent;
  23. /**
  24. * Return the containing <code>Multipart</code> object,
  25. * or <code>null</code> if not known.
  26. */
  27. public Multipart getParent() {
  28. return parent;
  29. }
  30. /**
  31. * Set the parent of this <code>BodyPart</code> to be the specified
  32. * <code>Multipart</code>. Normally called by <code>Multipart</code>'s
  33. * <code>addBodyPart</code> method. <code>parent</code> may be
  34. * <code>null</code> if the <code>BodyPart</code> is being removed
  35. * from its containing <code>Multipart</code>.
  36. * @since JavaMail 1.1
  37. */
  38. void setParent(Multipart parent) {
  39. this.parent = parent;
  40. }
  41. }