1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the "License"). You may not use this file except 5 * in compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * glassfish/bootstrap/legal/CDDLv1.0.txt or 9 * https://glassfish.dev.java.net/public/CDDLv1.0.html. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * HEADER in each file and include the License file at 15 * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 16 * add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your 18 * own identifying information: Portions Copyright [yyyy] 19 * [name of copyright owner] 20 */ 21 22 /* 23 * @(#)BodyPart.java 1.6 05/08/29 24 * 25 * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. 26 */ 27 28 package javax.mail; 29 30 /** 31 * This class models a Part that is contained within a Multipart. 32 * This is an abstract class. Subclasses provide actual implementations.<p> 33 * 34 * BodyPart implements the Part interface. Thus, it contains a set of 35 * attributes and a "content". 36 * 37 * @author John Mani 38 * @author Bill Shannon 39 */ 40 41 public abstract class BodyPart implements Part { 42 43 /** 44 * The <code>Multipart</code> object containing this <code>BodyPart</code>, 45 * if known. 46 * @since JavaMail 1.1 47 */ 48 protected Multipart parent; 49 50 /** 51 * Return the containing <code>Multipart</code> object, 52 * or <code>null</code> if not known. 53 */ 54 public Multipart getParent() { 55 return parent; 56 } 57 58 /** 59 * Set the parent of this <code>BodyPart</code> to be the specified 60 * <code>Multipart</code>. Normally called by <code>Multipart</code>'s 61 * <code>addBodyPart</code> method. <code>parent</code> may be 62 * <code>null</code> if the <code>BodyPart</code> is being removed 63 * from its containing <code>Multipart</code>. 64 * @since JavaMail 1.1 65 */ 66 void setParent(Multipart parent) { 67 this.parent = parent; 68 } 69 } 70