|
||||||||||
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 implicitly 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<? extends Structure> c,
boolean required,
boolean repeating)
Adds a new Structure (group or segment) to this Group. |
protected java.lang.String |
add(java.lang.Class<? extends Structure> c,
boolean required,
boolean repeating,
int index)
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). |
java.lang.String |
addNonstandardSegment(java.lang.String theName,
int theIndex)
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). |
void |
clear()
Clears all data from this structure. |
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<? extends Structure> |
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. |
ModelClassFactory |
getModelClassFactory()
|
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). |
Structure |
insertRepetition(java.lang.String name,
int index)
Inserts a repetition of a given Structure into repetitions of that structure by name. |
protected void |
insertRepetition(Structure structure,
int index)
Inserts a repetition of a given Structure into repetitions of that structure by name. |
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. |
Structure |
removeRepetition(java.lang.String name,
int index)
Removes a repetition of a given Structure objects by name. |
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 groupMethod Detail |
---|
public Structure get(java.lang.String name) throws HL7Exception
get
in interface Group
HL7Exception
- if the named Structure is not part of this Group.public Structure get(java.lang.String name, int rep) throws HL7Exception
get
in interface Group
HL7Exception
- 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 Group
HL7Exception
public java.lang.String addNonstandardSegment(java.lang.String theName, int theIndex) throws HL7Exception
Group
addNonstandardSegment
in interface Group
HL7Exception
public java.lang.String[] getNames()
get(name)
.
getNames
in interface Group
protected java.lang.String add(java.lang.Class<? extends Structure> c, boolean required, boolean repeating) throws HL7Exception
HL7Exception
protected java.lang.String add(java.lang.Class<? extends Structure> c, boolean required, boolean repeating, int index) throws HL7Exception
HL7Exception
public Message getMessage()
getMessage
in interface Structure
public Group getParent()
getParent
in interface Structure
public boolean isRequired(java.lang.String name) throws HL7Exception
isRequired
in interface Group
HL7Exception
public boolean isRepeating(java.lang.String name) throws HL7Exception
isRepeating
in interface Group
HL7Exception
public int currentReps(java.lang.String name) throws HL7Exception
HL7Exception
public Structure[] getAll(java.lang.String name) throws HL7Exception
getAll
in interface Group
HL7Exception
- if the named Structure is not part of this Group.public Structure removeRepetition(java.lang.String name, int index) throws HL7Exception
HL7Exception
- if the named Structure is not part of this Group.protected void insertRepetition(Structure structure, int index) throws HL7Exception
HL7Exception
- if the named Structure is not part of this Group.public Structure insertRepetition(java.lang.String name, int index) throws HL7Exception
HL7Exception
- if the named Structure is not part of this Group.public java.lang.Class<? extends Structure> getClass(java.lang.String name)
getClass
in interface Group
public java.lang.String getName()
getName
in interface Structure
Structure.getName()
public void clear()
public final ModelClassFactory getModelClassFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |