cdac.medinfo.sdk.hl7282.baselibs.messages

## Class HL7MessageValidator

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.messages.HL7MessageValidator

-     public final class HL7MessageValidator
      extends java.lang.Object

  Validator class to validate the HL7 message file.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HL7MessageValidator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MessageFactory` | `getMessageFactory()` Retrieves Message Factory.
    `void` | `setMessageFactory(MessageFactory objFactory)` Sets Message Factory.
    `boolean` | `validate(IHL7Stream objIHL7Stream)` Validates the stream of HL7 message.
    `boolean` | `validate(java.lang.String strFilePath)` Validates the HL7 message file.

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

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

- - ### Constructor Detail

    - #### HL7MessageValidator

          public HL7MessageValidator()

  - ### Method Detail

    - #### setMessageFactory

          public void setMessageFactory(MessageFactory objFactory)

      Sets Message Factory.
      Parameters:
        `objFactory` - instance of MessageFactory

    - #### getMessageFactory

          public MessageFactory getMessageFactory()

      Retrieves Message Factory.
      Returns:
        MessageFactory - instance of MessageFactory

    - #### validate

          public boolean validate(java.lang.String strFilePath)
                           throws java.io.IOException,
                                  InvalidMessageException

      Validates the HL7 message file.
      Parameters:
        `strFilePath` - String value of absolute path of HL7 message file
      Returns:
        True - if file is valide HL7 message file
      Throws:
        `java.io.IOException` - throws I/O Exception if parsing failed
        `InvalidMessageException` - throws Invalid Message Exception if validation fails

    - #### validate

          public boolean validate(IHL7Stream objIHL7Stream)
                           throws java.io.IOException,
                                  InvalidMessageException

      Validates the stream of HL7 message.
      Parameters:
        `objIHL7Stream` - Object of HL7Stream
      Returns:
        True - if file is valid HL7 message file
      Throws:
        `java.io.IOException` - throws I/O Exception if parsing failed
        `InvalidMessageException` - throws Invalid Message Exception if validation fails