|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uhn.hl7v2.model.Varies
public class Varies
Varies is a Type used as a placeholder for another Type in cases where the appropriate Type is not known until run-time (e.g. OBX-5). Parsers and validators may have logic that enforces restrictions on the Type based on other features of a segment.
If you want to set both the type and the values of a Varies object, you should set the type first by calling setData(Type t), keeping a reference to your Type, and then set values by calling methods on the Type. Here is an example:
CN cn = new CN();
variesObject.setData(cn);
cn.getIDNumber().setValue("foo");
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_OBX2_TYPE_PROP
System property key. |
Constructor Summary | |
---|---|
Varies(Message message)
Creates new Varies. |
Method Summary | |
---|---|
void |
clear()
Clears all data from this type |
java.lang.String |
encode()
Encodes this message using the parser returned by #getParser() |
static void |
fixOBX5(Segment segment,
ModelClassFactory factory)
Sets the data type of field 5 in the given OBX segment to the value of OBX-2. |
Type |
getData()
Returns the data contained by this instance of Varies. |
ExtraComponents |
getExtraComponents()
Returns extra components from the underlying Type |
Message |
getMessage()
|
java.lang.String |
getName()
Returns the name of the type (used in XML encoding and profile checking) |
void |
parse(java.lang.String string)
Parses the string into this message using the parser returned by #getParser() |
void |
setData(Type data)
Sets the data contained by this instance of Varies. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_OBX2_TYPE_PROP
Constructor Detail |
---|
public Varies(Message message)
message
- message to which this type belongsMethod Detail |
---|
public Type getData()
public java.lang.String getName()
Type
getName
in interface Type
Type.getName()
public void setData(Type data) throws DataTypeException
DataTypeException
public ExtraComponents getExtraComponents()
getExtraComponents
in interface Type
public Message getMessage()
getMessage
in interface Type
public static void fixOBX5(Segment segment, ModelClassFactory factory) throws HL7Exception
HL7Exception
public void parse(java.lang.String string) throws HL7Exception
#getParser()
parse
in interface Type
HL7Exception
public java.lang.String encode() throws HL7Exception
#getParser()
encode
in interface Type
HL7Exception
public void clear()
clear
in interface Type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |