org.licas.parsers

## Class BehaviourScriptParser

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

-     public class BehaviourScriptParser
      extends ServiceSpecParser

  This class can read a script file and parse it into a `BehaviourScript` object, or serialize back into XML again.
  Author:
    Kieran Greer

- - ### Field Summary

    - ### Fields inherited from class org.licas.parsers.ServiceSpecParser

      `passwordHandler`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BehaviourScript` | `parse(org.licas_xml.abs.Element scriptXml)` Parse the file path to create a test script for creating the test scenario from.
    `BehaviourScript` | `parseFile(java.lang.String filePath)` Parse the file path to create a test script for creating the test scenario from.
    `org.licas_xml.abs.Element` | `serialize(BehaviourScript testScript, boolean forDisplay)` Serialize the test script into XML.

    - ### Methods inherited from class org.licas.parsers.ServiceSpecParser

      `parse, serialize`

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

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

- - ### Constructor Detail

    - #### BehaviourScriptParser

          public BehaviourScriptParser(PasswordHandler thePasswordHandler)

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

  - ### Method Detail

    - #### serialize

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

      Serialize the test script 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.

    - #### parseFile

          public BehaviourScript parseFile(java.lang.String filePath)
                                    throws java.lang.Exception

      Parse the file path to create a test script for creating the test scenario from.
      Parameters:
        `filePath` - the script file path.
      Returns:
        the created test script object.
      Throws:
        `java.lang.Exception` - any error.

    - #### parse

          public BehaviourScript parse(org.licas_xml.abs.Element scriptXml)
                                throws java.lang.Exception

      Parse the file path to create a test script for creating the test scenario from.
      Parameters:
        `scriptXml` - the script document in XML format.
      Returns:
        the created test script object.
      Throws:
        `java.lang.Exception` - any error.