org.licas.service.resource.info

## Class InfoXml

- java.lang.Object
- - org.licas.service.resource.Resource
  - - org.licas.service.resource.info.InfoXml

-     public class InfoXml
      extends Resource

  This is used by a Service to store XML-based information specifically. Note that `getValue` returns an `Document` as the XML object, not a `nanoxml` Document that is used for the message passing.
  Author:
    Kieran Greer

- - ### Field Summary

    - ### 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
    `InfoXml(java.lang.String theDataType, org.licas_xml.abs.Element dataXml)` Create a new instance of InfoXml.

  - ### 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 currently loaded source information wrapped in an XML element.
    `java.lang.Object` | `getValue(org.licas_xml.abs.Element infoDescr)` Get the value itself and not a wrapped description.
    `boolean` | `parseInfo(org.licas_xml.abs.Element dataXml)` Parse the data description in the document to create the data object.

    - ### 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

    - #### InfoXml

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

      Create a new instance of InfoXml.
      Parameters:
        `theDataType` - the resource data type.
        `dataXml` - a description of the initialisation parameters. Can be null.
      Throws:
        `java.lang.Exception` - any error.

  - ### Method Detail

    - #### parseInfo

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

      Parse the data description in the document to create the data object. This version should read a file path. It can then either load in the contents or reference it dynamically.
      Specified by:
        `parseInfo` in class `Resource`
      Parameters:
        `dataXml` - the outermost element is not checked for, but might be a `DATA` or `DATASET` element. This should include a `Const`.`VALUE` element that stores a String-based file path description and possibly an `ACTION` element that can define if the data is stored in the resource or dynamically retrieved upon request through `<Data><Value>file path</Value><Action>the action</Action></Data>`. The action (`AiConst`.`LOADREMOTE`) stores the file path to dynamically retrieve the data upon request. Anything else, including no action, loads the data into the resource as binary contents.
      Returns:
        true if the file was successfully loaded, 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 currently loaded source information wrapped in an XML element.
      Specified by:
        `getInfo` in class `Resource`
      Parameters:
        `infoDescr` - a description of the info resource value that should be retrieved. Can be null as not used in this version.
      Returns:
        the value of the resource info as an XML element. This format is consistent with adding a `Data` element through an admin document.
      Throws:
        `java.lang.Exception` - any error.

    - #### getValue

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

      Get the value itself and not a wrapped description.
      Specified by:
        `getValue` in class `Resource`
      Parameters:
        `infoDescr` - a description of the info resource value that should be retrieved. Can be null as not used in this version.
      Returns:
        the info value.
      Throws:
        `java.lang.Exception` - any error.