/** * <p> * The content of the message, in HTML format. Use this for email clients that can process HTML. You can include * clickable links, formatted text, and much more in an HTML message. * </p> * * @param html * The content of the message, in HTML format. Use this for email clients that can process HTML. You can * include clickable links, formatted text, and much more in an HTML message. * @return Returns a reference to this object so that method calls can be chained together. */ public Body withHtml(Content html) { setHtml(html); return this; }
public Body unmarshall(StaxUnmarshallerContext context) throws Exception { Body body = new Body(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return body; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Text", targetDepth)) { body.setText(ContentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Html", targetDepth)) { body.setHtml(ContentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return body; } } } }
/** * <p> * The content of the message, in HTML format. Use this for email clients that can process HTML. You can include * clickable links, formatted text, and much more in an HTML message. * </p> * * @param html * The content of the message, in HTML format. Use this for email clients that can process HTML. You can * include clickable links, formatted text, and much more in an HTML message. * @return Returns a reference to this object so that method calls can be chained together. */ public Body withHtml(Content html) { setHtml(html); return this; }
public Body unmarshall(StaxUnmarshallerContext context) throws Exception { Body body = new Body(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("Text", targetDepth)) { body.setText(ContentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Html", targetDepth)) { body.setHtml(ContentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return body; }
public Body unmarshall(StaxUnmarshallerContext context) throws Exception { Body body = new Body(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return body; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Text", targetDepth)) { body.setText(ContentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Html", targetDepth)) { body.setHtml(ContentStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return body; } } } }