
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;


/**
 * 
 *                     An 'item' element contains any number of
 *                     <p/>
 *                     1. Dublin Core,<br/>
 *                     2. upnp,<br/>
 *                     3. res, and<br/>
 *                     4. desc elements.<br/>
 *                     <p/>
 *                     In all cases, the first element in each item child element sequence is required
 *                     to be "dc:title". The 'upnp:class' element must also appear under item. Each item
 *                     is additionally required to specify a value for the 'id' attribute. If the item
 *                     is actually a reference to another item, a value for 'refID' is specified.
 *                     Each item is also required to specify a value for the 'parentID attribute, as well
 *                     as the 'restricted' attribute (true, false, 1, 0). When restricted="true", the
 *                     ability to change or delete the item is restricted.
 *                     <p/>
 *                     Attributes:
 *                     <p/>
 *                     id type: string use: required<br/>
 *                     parentID type: string use: required<br/>
 *                     refID type: string use: optional<br/>
 *                     restricted type: boolean use: required<br/>
 *                     <p/>
 *                     The equivalent MPEG21 DIDL element is 'ITEM'.
 *                 
 * 
 * <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/}res"/>
 *         &lt;/choice>
 *       &lt;/sequence>
 *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       &lt;attribute name="refID" 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="restricted" use="required" 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 = "item")
public class Item {

    @XmlElementRef(name = "title", namespace = "http://purl.org/dc/elements/1.1/", type = Title.class)
    protected Title title;
    @XmlElementRefs({
        @XmlElementRef(name = "res", namespace = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/", type = Res.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
    protected String refID;
    @XmlAttribute(required = true)
    protected String parentID;
    @XmlAttribute(required = true)
    protected boolean restricted;

    /**
     * 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 Desc }
     * {@link Object }
     * {@link Res }
     * 
     * 
     */
    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 refID property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getRefID() {
        return refID;
    }

    /**
     * Sets the value of the refID property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setRefID(String value) {
        this.refID = 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 restricted property.
     * 
     */
    public boolean isRestricted() {
        return restricted;
    }

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

}
