ca.uhn.hl7v2.parser
Class Pointer
java.lang.Object
ca.uhn.hl7v2.parser.Pointer
- Direct Known Subclasses:
- GroupPointer, SegmentPointer
public abstract class Pointer
- extends java.lang.Object
A Pointer is a placeholder used in parsing traditionally encoded messages
(which do not explicitly identify segment groups). Implementations of Pointer
include SegmentPointer, which "points" to a Segment slot. This pointer can
exist whether or not the underlying Segment object has been created. There is
only one pointer per slot - multiple repetitions are accessed through the
same pointer. prepNewInstance
is used to create a new rep.
setSegment(String segment)
is responsible for parsing the given
segment string into the current rep of the underlying Segment. Similarly
there is a subclass called GroupPointer that points to a Group slot.
GroupPointer's setSegment(...)
method just forwards the request to
it's children (which are GroupPointers and SegmentPointers).
- Author:
- Bryan Tripp (bryan_tripp@sourceforge.net)
Method Summary |
abstract int |
setSegment(java.lang.String segment,
boolean correctOrder)
Parses the given String, which must contain a single traditionally encoded
message segment, into the current repetition of the message Structure
underlying this Pointer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FILL_FAILED_WRONG_SEGMENT
public static final int FILL_FAILED_WRONG_SEGMENT
- See Also:
- Constant Field Values
FILL_FAILED_FULL
public static final int FILL_FAILED_FULL
- See Also:
- Constant Field Values
FILL_OK
public static final int FILL_OK
- See Also:
- Constant Field Values
FILL_FAILED_OUT_OF_ORDER
public static final int FILL_FAILED_OUT_OF_ORDER
- See Also:
- Constant Field Values
parent
protected Group parent
position
protected int position
repeating
protected boolean repeating
encodingChars
protected EncodingCharacters encodingChars
Pointer
public Pointer()
setSegment
public abstract int setSegment(java.lang.String segment,
boolean correctOrder)
throws HL7Exception
- Parses the given String, which must contain a single traditionally encoded
message segment, into the current repetition of the message Structure
underlying this Pointer.
- Parameters:
segment
- the segment to parsecorrectOrder
- false if this segment should not actually be parsed because the
current location precedes the location of a segment that has already been
parsed. In this case, the return value should be either FILL_FAILED_FULL,
FILL_FAILED_WRONG_SEGMENT, or FILL_FAILED_OUT_OF_ORDER, but the segment should not
be parsed.
- Returns:
- an int indicating the success or flavours of failure of the request
- Throws:
HL7Exception
Copyright © 2001-2011 University Health Network. All Rights Reserved.