Package ca.uhn.hl7v2.model
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 Summary
Modifier and TypeMethodDescriptionbooleanLeaves a compositebooleanLeaves a field.booleanLeaves a group (or message)booleanLeaves a messagebooleanLeaves a segmentbooleanEnters a compositebooleanEnters a field.booleanEnters a group (or message)booleanEnters a messagebooleanEnters a segmentbooleanVisits a primitive
-
Method Details
-
start
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
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
Enters a group (or message)- Parameters:
group- grouplocation- 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
Leaves a group (or message)- Parameters:
group- grouplocation- 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
Enters a segment- Parameters:
segment- segmentlocation- 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
Leaves a segment- Parameters:
segment- segmentlocation- 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
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- fieldlocation- 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
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- fieldlocation- 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
Enters a composite- Parameters:
type- compositelocation- 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
Leaves a composite- Parameters:
type- compositelocation- 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
Visits a primitive- Parameters:
type- primitivelocation- 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
-