Package ca.uhn.hl7v2.model
Class GenericSegment
java.lang.Object
ca.uhn.hl7v2.model.AbstractStructure
ca.uhn.hl7v2.model.AbstractSegment
ca.uhn.hl7v2.model.GenericSegment
- All Implemented Interfaces:
Segment,Structure,Visitable,Serializable
An unspecified segment that has an undefined number of fields, each
of which is a Varies. The primary intended use is to store data from
Z segments. More precisely, any unknown segment that is encountered during
parsing will be handled with this class. This includes segments that do
not start with Z but nevertheless do not appear in the stated version
of HL7. Also, this class is not used to handle Z segments that have been
explicitly defined and declared (see Parser.packageList() ).
- Author:
- Bryan Tripp
- See Also:
-
Field Summary
Fields inherited from class ca.uhn.hl7v2.model.AbstractStructure
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TypecreateNewTypeWithoutReflection(int field) Attempts to create an instance of a field type without using reflection.getName()Returns the name specified at construction time.Methods inherited from class ca.uhn.hl7v2.model.AbstractSegment
accept, add, add, clear, encode, getField, getField, getLength, getMaxCardinality, getNames, getReps, getTypedField, getTypedField, insertRepetition, isEmpty, isRequired, main, numFields, parse, provideLocation, removeRepetitionMethods inherited from class ca.uhn.hl7v2.model.AbstractStructure
getMessage, getParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.hl7v2.model.Structure
getMessage, getParent
-
Constructor Details
-
GenericSegment
Creates a genric segment- Parameters:
parent- parent groupname- name of the segment
-
-
Method Details
-
getName
Returns the name specified at construction time.- Specified by:
getNamein interfaceStructure- Overrides:
getNamein classAbstractSegment- Returns:
- name of this structure
- See Also:
-
createNewTypeWithoutReflection
Attempts to create an instance of a field type without using reflection.
Note that the default implementation just returns
null, and it is not neccesary to override this method to provide any particular behaviour. When a new field instance is needed within a segment, this method is tried first, and if it returnsnull, reflection is used instead. Implementations of this method is auto-generated by the source generator module.- Overrides:
createNewTypeWithoutReflectionin classAbstractSegment- Parameters:
field- Field number - Note that this is zero indexed!- Returns:
- Returns a newly instantiated type, or
nullif not possible
-