001package ca.uhn.hl7v2.parser;
002
003/**
004 * Defines the behaviour to use when an unexpected
005 * segment is discovered while parsing a message.
006 * 
007 * @see ParserConfiguration#setUnexpectedSegmentBehaviour(UnexpectedSegmentBehaviourEnum)
008 */
009public enum UnexpectedSegmentBehaviourEnum {
010
011        /**
012         * <p>
013         * Add the segment as a 
014         * {@link ca.uhn.hl7v2.model.Message#addNonstandardSegment(String) nonstandard segment}
015         * at the current location, even if the current location is in a 
016         * child group within the message.
017         * </p>
018         * <p>
019         * This is the default.
020         * </p>
021         */
022        ADD_INLINE,
023
024        /**
025         * Return the parser back to the root of the message (even if the last
026         * segment was in a group) and add the unexpected segment as a
027         * {@link ca.uhn.hl7v2.model.Message#addNonstandardSegment(String) nonstandard segment}.
028         */
029        DROP_TO_ROOT,
030
031        /**
032         * Throw an {@link ca.uhn.hl7v2.HL7Exception}
033         */
034        THROW_HL7_EXCEPTION
035}