ca.uhn.hl7v2.model
Class ExtraComponents

java.lang.Object
  extended by ca.uhn.hl7v2.model.ExtraComponents
All Implemented Interfaces:
java.io.Serializable

public class ExtraComponents
extends java.lang.Object
implements java.io.Serializable

A set of "extra" components (sub-components) that are not a standard part of a field (component) but have been added at runtime. The purpose is to allow processing of locally-defined extensions to datatypes without the need for a custom message definition. Extra components are not treated uniformly with standard components (e.g. they are not accessible through methods like Primitive.getValue() and Composite.getComponent()). To do so would blur the distinction between primitive and composite types (i.e. leaf and non-leaf nodes), which seems nice and polymorphic for a moment but actually isn't helpful. Furthermore, the auto-generated classes do not define accessors to extra components, because they are meant to encourage and enforce use of the standard message structure -- stepping outside the standard structure must be deliberate. Note that a uniformity of access to standard and extra components is provided by Terser.

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
ExtraComponents(Message message)
          Creates a new instance of ExtraComponents
 
Method Summary
 Varies getComponent(int comp)
          Returns the component at the given location, creating it and all preceeding components if necessary.
 int numComponents()
          Returns the number of existing extra components
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtraComponents

public ExtraComponents(Message message)
Creates a new instance of ExtraComponents

Method Detail

numComponents

public int numComponents()
Returns the number of existing extra components


getComponent

public Varies getComponent(int comp)
Returns the component at the given location, creating it and all preceeding components if necessary.

Parameters:
comp - the extra component number starting at 0 (i.e. 0 is the first extra component)


Copyright © 2001-2011 University Health Network. All Rights Reserved.