All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.plivo.api.xml.P Maven / Gradle / Ivy

Go to download

A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML

There is a newer version: 5.46.0
Show newest version
package com.plivo.api.xml;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlMixed;
import java.util.List;
import com.plivo.api.exceptions.PlivoXmlException;

@XmlRootElement(name = "p")
public class P extends PlivoXml implements LangNestable,
                                           ProsodyNestable,
                                           SpeakNestable {

  @XmlMixed
  private List mixedContent = new ArrayList();

  public P() {
  }

  public P(String content) {
    this.mixedContent.add(content);
  }

  public P children(Object... nestables) throws PlivoXmlException {
    for (Object obj : nestables) {
      if (obj instanceof PNestable || obj instanceof String) {
        mixedContent.add(obj);
      } else {
        throw new PlivoXmlException("XML Validation Error: <" + obj.getClass().getSimpleName() + "> can not be nested in 

"); } } return this; } }