org.licas.parsers.admin

## Class AdminParser

- java.lang.Object
- - org.licas.parsers.admin.AdminParser

-     public class AdminParser
      extends java.lang.Object

  This class can be used to parse the administrator's xml description of a service. This class accepts the XML-based admin document description and creates an `AdminInfo` object from it.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdminParser()` Create a new instance of AdminParser.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.ArrayList<org.licas_xml.abs.Element>` | `getAllMethods(AdminInfo adminInfo, boolean removeBase)` Get a list of all of the methods in this admin document.
    `static org.licas_xml.abs.Element` | `getMethodDescription(org.licas_xml.abs.Element methodXml)` Retrieve the description part of the method xml description.
    `static java.lang.String` | `getMethodName(org.licas_xml.abs.Element methodXml)` Retrieve the name part of the method xml description.
    `static java.util.ArrayList<java.lang.String>` | `getMethodNames(org.licas_xml.abs.Element accessXml)` Get a list of all of the methods names in this access level.
    `java.util.ArrayList<org.licas_xml.abs.Element>` | `getMethods(org.licas_xml.abs.Element accessXml, boolean removeBase)` Get a list of all of the methods in this access level.
    `static java.lang.String` | `getPassword(org.licas_xml.abs.Element accessXml)` Retrieve the password part of the access level xml description.
    `static boolean` | `isAccessLevel(org.licas_xml.abs.Element accessXml, org.licas_xml.abs.Element methodXml)` Return true if the access info passed in contains a match to the method info.
    `static boolean` | `methodsMatch(org.licas_xml.abs.Element methodXml, org.licas_xml.abs.Element methodXml2)` Return true if the two xml method descriptions are the same.
    `AdminInfo` | `parse(org.licas_xml.abs.Element adminXml)` Parse the XML description to determine the admin specification.
    `org.licas_xml.abs.Element` | `serialize(AdminInfo adminInfo)` Serialize the admin info object into an XML-based description.

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

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

- - ### Constructor Detail

    - #### AdminParser

          public AdminParser()

      Create a new instance of AdminParser.

  - ### Method Detail

    - #### serialize

          public org.licas_xml.abs.Element serialize(AdminInfo adminInfo)
                                              throws java.lang.Exception

      Serialize the admin info object into an XML-based description.
      Parameters:
        `adminInfo` - the admin info object to serialize.
      Returns:
        an xml-based description of the object.
      Throws:
        `java.lang.Exception` - any error.

    - #### parse

          public AdminInfo parse(org.licas_xml.abs.Element adminXml)
                          throws java.lang.Exception

      Parse the XML description to determine the admin specification.
      Parameters:
        `adminXml` - the XML description to parse.
      Returns:
        the parsed admin information.
      Throws:
        `java.lang.Exception` - any error.

    - #### isAccessLevel

          public static boolean isAccessLevel(org.licas_xml.abs.Element accessXml,
                                              org.licas_xml.abs.Element methodXml)

      Return true if the access info passed in contains a match to the method info.
      Parameters:
        `accessXml` - an xml description of the access level.
        `methodXml` - an xml description of the method.
      Returns:
        true if the method spec is contained in the access level spec.

    - #### methodsMatch

          public static boolean methodsMatch(org.licas_xml.abs.Element methodXml,
                                             org.licas_xml.abs.Element methodXml2)

      Return true if the two xml method descriptions are the same.
      Parameters:
        `methodXml` - the first XML method description.
        `methodXml2` - the second XML method description.
      Returns:
        true if the two descriptions match.

    - #### getAllMethods

          public java.util.ArrayList<org.licas_xml.abs.Element> getAllMethods(AdminInfo adminInfo,
                                                                              boolean removeBase)

      Get a list of all of the methods in this admin document.
      Parameters:
        `adminInfo` - the admin info.
        `removeBase` - if true remove known base 'Object' methods.
      Returns:
        the list of all method descriptions in the admin document in XML format.

    - #### getMethods

          public java.util.ArrayList<org.licas_xml.abs.Element> getMethods(org.licas_xml.abs.Element accessXml,
                                                                           boolean removeBase)

      Get a list of all of the methods in this access level.
      Parameters:
        `accessXml` - the access level info.
        `removeBase` - if true remove known base 'Object' methods.
      Returns:
        the list of methods at this level in XML format.

    - #### getMethodNames

          public static java.util.ArrayList<java.lang.String> getMethodNames(org.licas_xml.abs.Element accessXml)

      Get a list of all of the methods names in this access level.
      Parameters:
        `accessXml` - the access level info.
      Returns:
        the list of method names at this level. Values are of type String.

    - #### getMethodName

          public static java.lang.String getMethodName(org.licas_xml.abs.Element methodXml)

      Retrieve the name part of the method xml description.
      Parameters:
        `methodXml` - the method description in xml.
      Returns:
        the method name.

    - #### getMethodDescription

          public static org.licas_xml.abs.Element getMethodDescription(org.licas_xml.abs.Element methodXml)

      Retrieve the description part of the method xml description.
      Parameters:
        `methodXml` - the method description in xml.
      Returns:
        the description part.

    - #### getPassword

          public static java.lang.String getPassword(org.licas_xml.abs.Element accessXml)

      Retrieve the password part of the access level xml description.
      Parameters:
        `accessXml` - the access level description in xml.
      Returns:
        the description part.