/** * Constructs a new Body object. Callers should use the setter or fluent setter (with...) methods to initialize any * additional object members. * * @param text * The content of the message, in text format. Use this for text-based email clients, or clients on * high-latency networks (such as mobile devices). */ public Body(Content text) { setText(text); }
/** * <p> * The content of the message, in text format. Use this for text-based email clients, or clients on high-latency * networks (such as mobile devices). * </p> * * @param text * The content of the message, in text format. Use this for text-based email clients, or clients on * high-latency networks (such as mobile devices). * @return Returns a reference to this object so that method calls can be chained together. */ public Body withText(Content text) { setText(text); 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; } } } }
/** * Constructs a new Body object. Callers should use the setter or fluent * setter (with...) methods to initialize any additional object members. * * @param text <p> * The content of the message, in text format. Use this for * text-based email clients, or clients on high-latency networks * (such as mobile devices). * </p> */ public Body(Content text) { setText(text); }
/** * Constructs a new Body object. Callers should use the setter or fluent setter (with...) methods to initialize any * additional object members. * * @param text * The content of the message, in text format. Use this for text-based email clients, or clients on * high-latency networks (such as mobile devices). */ public Body(Content text) { setText(text); }
/** * <p> * The content of the message, in text format. Use this for text-based email clients, or clients on high-latency * networks (such as mobile devices). * </p> * * @param text * The content of the message, in text format. Use this for text-based email clients, or clients on * high-latency networks (such as mobile devices). * @return Returns a reference to this object so that method calls can be chained together. */ public Body withText(Content text) { setText(text); 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; } } } }