org.licas.service.resource.container

## Class ListContainer

- java.lang.Object
- - org.licas.service.resource.Resource
  - - org.licas.service.resource.container.ResourceContainer
    - - org.licas.service.resource.container.ListContainer

-     public class ListContainer
      extends ResourceContainer

  This can be used to store an array or set of `Resource` derived objects that can then be invoked upon request. Either the full list of resources can be returned or a list as defined by a set of IDs (typically the resource `uuid`). The resource objects do not have to be of the same type and it is their `getInfo` or `getValue` methods that are invoked. A container might be initialised with a script that includes the details of the stored resources.
  Author:
    Kieran Greer

- - ### Field Summary

    - ### Fields inherited from class org.licas.service.resource.container.ResourceContainer

      `resourceList`

    - ### Fields inherited from class org.licas.service.resource.Resource

      `dataType, INFOANYTYPE, INFOBINARYTYPE, INFOHTMLTYPE, INFOSTREAMXMLTYPE, INFOSTRINGTYPE, INFOTEXTTYPE, INFOURLTYPE, INFOXMLTYPE, LISTCONTAINERTYPE, QUERYCONTAINERTYPE, RANDOMCONTAINERTYPE, uuid`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ListContainer(java.lang.String theDataType)` Create a new instance of ListContainer.
    `ListContainer(java.lang.String theDataType, org.licas_xml.abs.Element dataXml)` Create a new instance of ListContainer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.licas_xml.abs.Element` | `getInfo(org.licas_xml.abs.Element infoDescr)` Get the source information wrapped in an XML element.
    `java.util.ArrayList<java.lang.Object>` | `getValue(org.licas_xml.abs.Element infoDescr)` Get the currently selected value itself and not a wrapped description.
    `protected boolean` | `parseInfo(org.licas_xml.abs.Element dataXml)` Parse the data description in the admin document to create the data object.

    - ### Methods inherited from class org.licas.service.resource.container.ResourceContainer

      `addResource, createContainer, getResource, getResourceIDs, removeResource`

    - ### Methods inherited from class org.licas.service.resource.Resource

      `createResource, dataFromResourceType, getDataType, getUUID, parseValueElem, resourceTypeForDataType, setUUID, setUUID`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ListContainer

          public ListContainer(java.lang.String theDataType)
                        throws java.lang.Exception

      Create a new instance of ListContainer.
      Parameters:
        `theDataType` - the container type.
      Throws:
        `java.lang.Exception` - any error.

    - #### ListContainer

          public ListContainer(java.lang.String theDataType,
                               org.licas_xml.abs.Element dataXml)
                        throws java.lang.Exception

      Create a new instance of ListContainer.
      Parameters:
        `theDataType` - the container type.
        `dataXml` - a description of the initialisation parameters.
      Throws:
        `java.lang.Exception` - any error.

  - ### Method Detail

    - #### parseInfo

          protected boolean parseInfo(org.licas_xml.abs.Element dataXml)
                               throws java.lang.Exception

      Parse the data description in the admin document to create the data object.
      Overrides:
        `parseInfo` in class `ResourceContainer`
      Parameters:
        `dataXml` - the `Data` element of the admin document. This should include the container `DataType` element and a `Value` element that stores a list of child `Data` elements that store information for each resource to create. These are processed as defined in the individual resource object comments.
      Returns:
        true if any specified resources are successfully added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### getInfo

          public org.licas_xml.abs.Element getInfo(org.licas_xml.abs.Element infoDescr)
                                            throws java.lang.Exception

      Get the source information wrapped in an XML element.
      Specified by:
        `getInfo` in class `Resource`
      Parameters:
        `infoDescr` - a description of the info resource values that should be retrieved. This can be empty, or include a list of ID elements, each of which stores a resource id to retrieve.
      Returns:
        a value for every resource in the list. This format is consistent with adding an XML `Data` element through an admin document.
      Throws:
        `java.lang.Exception` - any error.

    - #### getValue

          public java.util.ArrayList<java.lang.Object> getValue(org.licas_xml.abs.Element infoDescr)
                                                         throws java.lang.Exception

      Get the currently selected value itself and not a wrapped description. This can be empty, or include a list of ID elements, each of which stores a resource id to retrieve.
      Specified by:
        `getValue` in class `Resource`
      Parameters:
        `infoDescr` - a description of the info resource value that should be retrieved, but can be null.
      Returns:
        a list storing a value for every resource in the list.
      Throws:
        `java.lang.Exception` - any error.