org.licas.parsers

## Class ServiceSpecParser

- java.lang.Object
- - org.licas.parsers.ServiceSpecParser

- Direct Known Subclasses:
    BehaviourScriptParser

      public class ServiceSpecParser
      extends java.lang.Object

  This class can read a script file and parse it into a `ServiceSpec` object, or serialize back into XML again. You would typically use a `BehaviourScript` and related parser, so this is just for convenience.
  Author:
    Kieran Greer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PasswordHandler` | `passwordHandler` For storing passwords

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceSpecParser(PasswordHandler thePasswordHandler)` Create a new instance of ServiceSpecParser.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `parse(org.licas_xml.abs.Element scriptXml, ServiceSpec serviceSpec)` Parse the file path to create a base service script specification.
    `org.licas_xml.abs.Element` | `serialize(ServiceSpec testScript, boolean forDisplay)` Serialize the base service script specification into XML.

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

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

- - ### Field Detail

    - #### passwordHandler

          protected PasswordHandler passwordHandler

      For storing passwords

  - ### Constructor Detail

    - #### ServiceSpecParser

          public ServiceSpecParser(PasswordHandler thePasswordHandler)

      Create a new instance of ServiceSpecParser.
      Parameters:
        `thePasswordHandler` - for storing passwords.

  - ### Method Detail

    - #### serialize

          public org.licas_xml.abs.Element serialize(ServiceSpec testScript,
                                                     boolean forDisplay)
                                              throws java.lang.Exception

      Serialize the base service script specification into XML.
      Parameters:
        `testScript` - the test script to serialize.
        `forDisplay` - if true, create output for display purposes only.
      Returns:
        the script in XML format.
      Throws:
        `java.lang.Exception` - any error.

    - #### parse

          public void parse(org.licas_xml.abs.Element scriptXml,
                            ServiceSpec serviceSpec)
                     throws java.lang.Exception

      Parse the file path to create a base service script specification.
      Parameters:
        `scriptXml` - the script document in XML format.
        `serviceSpec` - the service script specification object.
      Throws:
        `java.lang.Exception` - any error.