|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectca.uhn.hl7v2.model.AbstractGroup
public abstract class AbstractGroup
A partial implementation of Group. Subclasses correspond to specific groups of segments (and/or other sub-groups) that are implicitely defined by message structures in the HL7 specification. A subclass should define it's group structure by putting repeated calls to the add(...) method in it's constructor. Each call to add(...) adds a specific component to the Group.
| Constructor Summary | |
|---|---|
protected |
AbstractGroup(Group parent,
ModelClassFactory factory)
This constructor should be used by implementing classes that do not also implement Message. |
protected |
AbstractGroup(ModelClassFactory factory)
This constructor should only be used by classes that implement Message directly. |
| Method Summary | |
|---|---|
protected java.lang.String |
add(java.lang.Class c,
boolean required,
boolean repeating)
Adds a new Structure (group or segment) to this Group. |
java.lang.String |
addNonstandardSegment(java.lang.String name)
Expands the group definition to include a segment that is not defined by HL7 to be part of this group (eg an unregistered Z segment). |
int |
currentReps(java.lang.String name)
Returns the number of existing repetitions of the named structure. |
Structure |
get(java.lang.String name)
Returns the named structure. |
Structure |
get(java.lang.String name,
int rep)
Returns a particular repetition of the named Structure. |
Structure[] |
getAll(java.lang.String name)
Returns an array of Structure objects by name. |
java.lang.Class |
getClass(java.lang.String name)
Returns the Class of the Structure at the given name index. |
Message |
getMessage()
Returns the Message to which this segment belongs. |
java.lang.String |
getName()
Returns the class name (excluding package). |
java.lang.String[] |
getNames()
Returns an ordered array of the names of the Structures in this Group. |
Group |
getParent()
Returns the parent group within which this structure exists (may be root message group). |
boolean |
isRepeating(java.lang.String name)
Returns true if the named structure is required. |
boolean |
isRequired(java.lang.String name)
Returns true if the named structure is required. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractGroup(Group parent,
ModelClassFactory factory)
parent - the group to which this Group belongs.factory - the factory for classes of segments, groups, and datatypes under this groupprotected AbstractGroup(ModelClassFactory factory)
factory - the factory for classes of segments, groups, and datatypes under this group| Method Detail |
|---|
public Structure get(java.lang.String name)
throws HL7Exception
get in interface GroupHL7Exception - if the named Structure is not part of this Group.
public Structure get(java.lang.String name,
int rep)
throws HL7Exception
get in interface GroupHL7Exception - if the named Structure is not part of this group,
if the structure is not repeatable and the given rep is > 0,
or if the given repetition number is more than one greater than the
existing number of repetitions.
public java.lang.String addNonstandardSegment(java.lang.String name)
throws HL7Exception
addNonstandardSegment in interface GroupHL7Exceptionpublic java.lang.String[] getNames()
get(name).
getNames in interface Group
protected java.lang.String add(java.lang.Class c,
boolean required,
boolean repeating)
throws HL7Exception
HL7Exceptionpublic Message getMessage()
getMessage in interface Structurepublic Group getParent()
getParent in interface Structure
public boolean isRequired(java.lang.String name)
throws HL7Exception
isRequired in interface GroupHL7Exception
public boolean isRepeating(java.lang.String name)
throws HL7Exception
isRepeating in interface GroupHL7Exception
public int currentReps(java.lang.String name)
throws HL7Exception
HL7Exception
public Structure[] getAll(java.lang.String name)
throws HL7Exception
getAll in interface GroupHL7Exception - if the named Structure is not part of this Group.public java.lang.Class getClass(java.lang.String name)
getClass in interface Grouppublic java.lang.String getName()
getName in interface StructureStructure.getName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||