View Javadoc

1   package ca.uhn.hl7v2.parser;
2   
3   import ca.uhn.hl7v2.HL7Exception;
4   import ca.uhn.hl7v2.model.Message;
5   
6   /**
7    * Defines the behaviour to use when an unexpected
8    * segment is discovered while parsing a message.
9    * 
10   * @see ParserConfiguration#setUnexpectedSegmentBehaviour(UnexpectedSegmentBehaviourEnum)
11   */
12  public enum UnexpectedSegmentBehaviourEnum {
13  
14  	/**
15  	 * <p>
16  	 * Add the segment as a 
17  	 * {@link Message#addNonstandardSegment(String) nonstandard segment}
18  	 * at the current location, even if the current location is in a 
19  	 * child group within the message.
20  	 * </p>
21  	 * <p>
22  	 * This is the default.
23  	 * </p>
24  	 */
25  	ADD_INLINE,
26  
27  	/**
28  	 * Return the parser back to the root of the message (even if the last
29  	 * segment was in a group) and add the unexpected segment as a
30  	 * {@link Message#addNonstandardSegment(String) nonstandard segment}.
31  	 */
32  	DROP_TO_ROOT,
33  
34  	/**
35  	 * Throw an {@link HL7Exception}
36  	 */
37  	THROW_HL7_EXCEPTION
38  }