本文整理了Java中javax.mail.Multipart.getParent()
方法的一些代码示例,展示了Multipart.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Multipart.getParent()
方法的具体详情如下:
包路径:javax.mail.Multipart
类名称:Multipart
方法名:getParent
[英]Return the Part
that contains this Multipart
object, or null
if not known.
[中]返回包含此Multipart
对象的Part
,如果未知,返回null
。
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
private Message getMessageFrom(Part p) {
while (p != null) {
if (p instanceof Message) {
return (Message) p;
}
Multipart mp = ((BodyPart) p).getParent();
if (mp == null) {
return null;
}
p = mp.getParent();
}
return null;
}
}
代码示例来源:origin: com.sun.mail/android-mail
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: javax.mail/javax.mail-api
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: com.sun.mail/jakarta.mail
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: javax.mail/com.springsource.javax.mail
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: org.glassfish.metro/webservices-extra
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: com.sun.mail/mailapi
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
/**
* recurse up the chain of MultiPart/BodyPart parts until we hit a message
*
* @param p The starting part.
*
* @return The encountered Message or null if no Message parts
* are found.
*/
private Message getMessageFrom(Part p) {
while (p != null) {
if (p instanceof Message) {
return (Message) p;
}
Multipart mp = ((BodyPart) p).getParent();
if (mp == null) {
return null;
}
p = mp.getParent();
}
return null;
}
}
代码示例来源:origin: jboss/jboss-javaee-specs
/**
* Return the Message containing an arbitrary Part.
* Follows the parent chain up through containing Multipart
* objects until it comes to a Message object, or null.
*
* @return the containing Message, or null if none
* @see javax.mail.BodyPart#getParent
* @see javax.mail.Multipart#getParent
*/
private static Message getMessage(Part p) throws MessagingException {
while (p != null) {
if (p instanceof Message)
return (Message)p;
BodyPart bp = (BodyPart)p;
Multipart mp = bp.getParent();
if (mp == null) // MimeBodyPart might not be in a MimeMultipart
return null;
p = mp.getParent();
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!