Interface MessageVisitor

All Known Implementing Classes:
DelegatingMessageVisitor, MessageVisitors.PopulatedVisitor, MessageVisitors.StructuresVisitor, MessageVisitorSupport, ValidatingMessageVisitor

public interface MessageVisitor
A MessageVisitor can be used to traverse a message structure. Everytime a message element is found, the corresponding visitable method is called. If a method returns true, the visiting process is continued, otherwise abandoned.

A MessageVisitor should usually only be called by Visitable.accept(MessageVisitor, Location).

  • Method Details

    • start

      boolean start(Message message) throws HL7Exception
      Enters a message
      Parameters:
      message - message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting
    • end

      boolean end(Message message) throws HL7Exception
      Leaves a message
      Parameters:
      message - message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting
    • start

      boolean start(Group group, Location location) throws HL7Exception
      Enters a group (or message)
      Parameters:
      group - group
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting
    • end

      boolean end(Group group, Location location) throws HL7Exception
      Leaves a group (or message)
      Parameters:
      group - group
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall continue visiting the parent structure
      Throws:
      HL7Exception - if an error occurred while visiting
    • start

      boolean start(Segment segment, Location location) throws HL7Exception
      Enters a segment
      Parameters:
      segment - segment
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting
    • end

      boolean end(Segment segment, Location location) throws HL7Exception
      Leaves a segment
      Parameters:
      segment - segment
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall continue visiting the parent structure
      Throws:
      HL7Exception - if an error occurred while visiting
    • start

      boolean start(Field field, Location location) throws HL7Exception
      Enters a field. Note that a field is *not* a physical part of the HAPI model class hierarchy; it merely encapsulates all repetitions of a specific field along with its substructures.
      Parameters:
      field - field
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting
    • end

      boolean end(Field field, Location location) throws HL7Exception
      Leaves a field. Note that a field is *not* a physical part of the HAPI model class hierarchy; it merely encapsulates all repetitions of a specific field along with its substructures.
      Parameters:
      field - field
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall continue visiting the parent structure
      Throws:
      HL7Exception - if an error occurred while visiting
    • start

      boolean start(Composite type, Location location) throws HL7Exception
      Enters a composite
      Parameters:
      type - composite
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting
    • end

      boolean end(Composite type, Location location) throws HL7Exception
      Leaves a composite
      Parameters:
      type - composite
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall continue visiting the parent structure
      Throws:
      HL7Exception - if an error occurred while visiting
    • visit

      boolean visit(Primitive type, Location location) throws HL7Exception
      Visits a primitive
      Parameters:
      type - primitive
      location - Location object describing the location within the message
      Returns:
      true if the visitor shall descend into the nested structures
      Throws:
      HL7Exception - if an error occurred while visiting