org.licas.parsers.types

## Class ListParser

- java.lang.Object
- - org.licas.parsers.types.ListParser

- All Implemented Interfaces:
    org.ai_heuristic.def.ParserDef
  Direct Known Subclasses:
    ArrayListParser, HashMapParser, HashtableParser, LinkedHashMapParser, LinkedListParser, VectorParser

      public abstract class ListParser
      extends java.lang.Object
      implements org.ai_heuristic.def.ParserDef

  This class parses standard list structures of simple types or other list structures. This class is extended by the `HashMap` and the `ArrayList` parsers.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ARRAYCLASS` Defines an array class

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ListParser()` Creates a new instance of ListParser

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `createAddListObject(java.util.List data, java.lang.String type, java.lang.String value, org.licas_xml.abs.Element rootElem)` Create and add the object as specified by the parameters.
    `protected static void` | `createAddMapObject(java.util.Map data, java.lang.String type, java.lang.String key, java.lang.String value, org.licas_xml.abs.Element rootElem)` Create and add the object as specified by the parameters.
    `static boolean` | `isList(java.lang.Class param1, org.licas_xml.abs.Element xmlElem)` Return true if the xml element is a parsed list of the same type as the class passed in.

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

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

    - ### Methods inherited from interface org.ai_heuristic.def.ParserDef

      `parse, serialize`

- - ### Field Detail

    - #### ARRAYCLASS

          public static final java.lang.String ARRAYCLASS

      Defines an array class
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ListParser

          public ListParser()

      Creates a new instance of ListParser

  - ### Method Detail

    - #### createAddListObject

          protected static void createAddListObject(java.util.List data,
                                                    java.lang.String type,
                                                    java.lang.String value,
                                                    org.licas_xml.abs.Element rootElem)
                                             throws java.lang.Exception

      Create and add the object as specified by the parameters.
      Parameters:
        `data` - the list to store the data in.
        `type` - the object type.
        `value` - the object value if there is one.
        `rootElem` - root element if need to parse further.
      Throws:
        `java.lang.Exception` - any error.

    - #### createAddMapObject

          protected static void createAddMapObject(java.util.Map data,
                                                   java.lang.String type,
                                                   java.lang.String key,
                                                   java.lang.String value,
                                                   org.licas_xml.abs.Element rootElem)
                                            throws java.lang.Exception

      Create and add the object as specified by the parameters.
      Parameters:
        `data` - the map to store the data in.
        `type` - the object type.
        `key` - the entry key.
        `value` - the object value if there is one.
        `rootElem` - root element if need to parse further.
      Throws:
        `java.lang.Exception` - any error.

    - #### isList

          public static boolean isList(java.lang.Class param1,
                                       org.licas_xml.abs.Element xmlElem)

      Return true if the xml element is a parsed list of the same type as the class passed in. It should also be either a ArrayList, a HashMap or an Array[ of simple types String/Integer/Float/Double/Byte/Boolean.
      Parameters:
        `param1` - the parameter class to compare.
        `xmlElem` - the xml element.
      Returns:
        true if its root element contains the list type as an attribute.