com.amazonaws.services.simpleemail.model.Body.setHtml()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中com.amazonaws.services.simpleemail.model.Body.setHtml()方法的一些代码示例,展示了Body.setHtml()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.setHtml()方法的具体详情如下:
包路径:com.amazonaws.services.simpleemail.model.Body
类名称:Body
方法名:setHtml

Body.setHtml介绍

[英]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.
[中]以HTML格式显示消息的内容。用于可以处理HTML的电子邮件客户端。您可以在HTML消息中包含可单击链接、格式化文本以及更多内容。

代码示例

代码示例来源:origin: aws/aws-sdk-java

/**
 * <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;
}

代码示例来源:origin: aws/aws-sdk-java

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;
      }
    }
  }
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-ses

/**
 * <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;
}

代码示例来源:origin: aws-amplify/aws-sdk-android

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;
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-ses

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;
      }
    }
  }
}

相关文章