Package ca.uhn.hl7v2.model
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 TypeMethodDescriptionbooleanaccept(MessageVisitor visitor, Location currentLocation) Callback method for the visitor.booleanisEmpty()Returns true if this Visitable has actual contentprovideLocation(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
Callback method for the visitor. This method is supposed to either directly call one of the visitors methods, passingthisas parameter, or traverse through a hierarchical substructure and call accept(MessageVisitor) for each visited element.- Parameters:
visitor- MessageVisitor instance to be called backcurrentLocation- location of this object- Returns:
trueif the visit process shall continue- Throws:
HL7Exception- if a problem occurred during visiting
-
provideLocation
Reusing the location of this object's parent, this method returns its own location within the message.- Parameters:
parentLocation- the parents locationindex- index of this objectrepetition- repetition of this object- Returns:
- this objects location
-
isEmpty
Returns true if this Visitable has actual content- Returns:
- true if Visitable is empty
- Throws:
HL7Exception- if an error occurred while determining emptiness
-