
package org.teleal.cling.support.contentdirectory.descriptor.didl;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.teleal.cling.support.contentdirectory.descriptor.dc.Title;


/**
 * 
 *                     A 'container' element may contain any number of
 *                     <p>
 *                     1. Dublin Core,<br/>
 *                     2. upnp,<br/>
 *                     3. res,<br/>
 *                     4. ref,<br/>
 *                     5 item,<br/>
 *                     6. container<br/>
 *                     and 7. desc elements.<br/>
 *                     <p>
 *                     In all cases, the first element in each container child element sequence is
 *                     required to be "dc:title". The 'upnp:class' element must also appear under
 *                     container. Each container is required to specify a value for the 'id'
 *                     and 'parentID' attributes. Each container is also required to specify a value for
 *                     the 'restricted' attribute (true, false, 1, 0). When restricted="true", the ability to
 *                     change or delete the container is restricted.
 *                     <p>
 *                     Other optional container element attributes are 'parentID', 'childCount',
 *                     and 'searchable'.
 *                     <p>
 *                     Other optional attributes are 'parentID' and 'childCount'.
 *                     <p>
 *                     Attributes:
 *                     <p>
 *                     id type: string use: required<br/>
 *                     parentID type: string use: required<br/>
 *                     childCount type: int use: optional<br/>
 *                     restricted type: boolean use: required<br/>
 *                     <p>
 *                     The equivalent MPEG21 DIDL element is 'CONTAINER'
 *                 
 * 
 * <p>Java class for anonymous complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element ref="{http://purl.org/dc/elements/1.1/}title"/>
 *         &lt;choice maxOccurs="unbounded" minOccurs="0">
 *           &lt;any namespace='urn:schemas-upnp-org:metadata-1-0/upnp/'/>
 *           &lt;any namespace='http://purl.org/dc/elements/1.1/'/>
 *           &lt;element ref="{urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/}desc"/>
 *           &lt;element ref="{urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/}item"/>
 *           &lt;element ref="{urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/}res"/>
 *           &lt;element ref="{urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/}container"/>
 *         &lt;/choice>
 *       &lt;/sequence>
 *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       &lt;attribute name="parentID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       &lt;attribute name="childCount" type="{http://www.w3.org/2001/XMLSchema}int" />
 *       &lt;attribute name="restricted" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       &lt;attribute name="searchable" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "title",
    "children"
})
@XmlRootElement(name = "container")
public class Container {

    @XmlElementRef(name = "title", namespace = "http://purl.org/dc/elements/1.1/", type = Title.class)
    protected Title title;
    @XmlElementRefs({
        @XmlElementRef(name = "item", namespace = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/", type = Item.class),
        @XmlElementRef(name = "res", namespace = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/", type = Res.class),
        @XmlElementRef(name = "container", namespace = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/", type = Container.class),
        @XmlElementRef(name = "desc", namespace = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/", type = Desc.class)
    })
    @XmlAnyElement(lax = true)
    protected List<Object> children;
    @XmlAttribute(required = true)
    protected String id;
    @XmlAttribute(required = true)
    protected String parentID;
    @XmlAttribute
    protected Integer childCount;
    @XmlAttribute(required = true)
    protected boolean restricted;
    @XmlAttribute
    protected Boolean searchable;

    /**
     * Gets the value of the title property.
     * 
     * @return
     *     possible object is
     *     {@link Title }
     *     
     */
    public Title getTitle() {
        return title;
    }

    /**
     * Sets the value of the title property.
     * 
     * @param value
     *     allowed object is
     *     {@link Title }
     *     
     */
    public void setTitle(Title value) {
        this.title = value;
    }

    /**
     * Gets the value of the children property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the children property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getChildren().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Item }
     * {@link Object }
     * {@link Res }
     * {@link Container }
     * {@link Desc }
     * 
     * 
     */
    public List<Object> getChildren() {
        if (children == null) {
            children = new ArrayList<Object>();
        }
        return this.children;
    }

    /**
     * Gets the value of the id property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setId(String value) {
        this.id = value;
    }

    /**
     * Gets the value of the parentID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getParentID() {
        return parentID;
    }

    /**
     * Sets the value of the parentID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setParentID(String value) {
        this.parentID = value;
    }

    /**
     * Gets the value of the childCount property.
     * 
     * @return
     *     possible object is
     *     {@link Integer }
     *     
     */
    public Integer getChildCount() {
        return childCount;
    }

    /**
     * Sets the value of the childCount property.
     * 
     * @param value
     *     allowed object is
     *     {@link Integer }
     *     
     */
    public void setChildCount(Integer value) {
        this.childCount = value;
    }

    /**
     * Gets the value of the restricted property.
     * 
     */
    public boolean isRestricted() {
        return restricted;
    }

    /**
     * Sets the value of the restricted property.
     * 
     */
    public void setRestricted(boolean value) {
        this.restricted = value;
    }

    /**
     * Gets the value of the searchable property.
     * 
     * @return
     *     possible object is
     *     {@link Boolean }
     *     
     */
    public Boolean isSearchable() {
        return searchable;
    }

    /**
     * Sets the value of the searchable property.
     * 
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *     
     */
    public void setSearchable(Boolean value) {
        this.searchable = value;
    }

}
