Interface Visitable

All Known Subinterfaces:
Composite, Group, Message, Primitive, Segment, Structure, SuperStructure, Type, Variable
All Known Implementing Classes:
AbstractComposite, AbstractGroup, AbstractMessage, AbstractPersonNameComposite, AbstractPrimitive, AbstractSegment, AbstractStructure, AbstractSuperMessage, AbstractTextPrimitive, AbstractType, CM, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DTM, DTM, DTM, DTM, DTM, DTM, DTM, Field, GenericComposite, GenericGroup, GenericMessage, GenericMessage.UnknownVersion, GenericMessage.V21, GenericMessage.V22, GenericMessage.V23, GenericMessage.V231, GenericMessage.V24, GenericMessage.V25, GenericMessage.V251, GenericMessage.V26, GenericMessage.V27, GenericMessage.V271, GenericMessage.V28, GenericMessage.V281, GenericPrimitive, GenericSegment, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, IDWithNamespace, IS, IS, IS, IS, IS, IS, IS, IS, IS, IS, IS, IS, ISWithNamespace, NULLDT, NULLDT, NULLDT, NULLDT, NULLDT, NULLDT, NULLDT, SNM, SNM, SNM, SNM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TS, TSComponentOne, TSComponentOne, TSComponentOne, TSComponentOne, TSComponentOne, Varies

public interface Visitable
Interface that marks implementing classes as being capable to be visited by a MessageVisitor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(MessageVisitor visitor, Location currentLocation)
    Callback method for the visitor.
    boolean
    Returns true if this Visitable has actual content
    provideLocation(Location parentLocation, int index, int repetition)
    Reusing the location of this object's parent, this method returns its own location within the message.
  • Method Details

    • accept

      boolean accept(MessageVisitor visitor, Location currentLocation) throws HL7Exception
      Callback method for the visitor. This method is supposed to either directly call one of the visitors methods, passing this as parameter, or traverse through a hierarchical substructure and call accept(MessageVisitor) for each visited element.
      Parameters:
      visitor - MessageVisitor instance to be called back
      currentLocation - location of this object
      Returns:
      true if the visit process shall continue
      Throws:
      HL7Exception - if a problem occurred during visiting
    • provideLocation

      Location provideLocation(Location parentLocation, int index, int repetition)
      Reusing the location of this object's parent, this method returns its own location within the message.
      Parameters:
      parentLocation - the parents location
      index - index of this object
      repetition - repetition of this object
      Returns:
      this objects location
    • isEmpty

      boolean isEmpty() throws HL7Exception
      Returns true if this Visitable has actual content
      Returns:
      true if Visitable is empty
      Throws:
      HL7Exception - if an error occurred while determining emptiness