|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uhn.hl7v2.parser.CustomModelClassFactory
public class CustomModelClassFactory
ModelClassFactory which allows custom packages to search to be specified. These packages will be searched first, and if nothing is found for a particular structure, DefaultModelClassFactory is used.
Constructor Summary | |
---|---|
CustomModelClassFactory()
Constructor which just delegated to DefaultModelClassFactory |
|
CustomModelClassFactory(java.util.Map<java.lang.String,java.lang.String[]> map)
Constructor |
|
CustomModelClassFactory(java.lang.String packageName)
Constructor |
Method Summary | |
---|---|
protected java.lang.Class<?> |
findClass(java.lang.String subpackage,
java.lang.String name,
java.lang.String version)
Finds appropriate classes to be loaded for the given structure/type |
java.lang.Class<? extends Group> |
getGroupClass(java.lang.String name,
java.lang.String version)
|
java.lang.Class<? extends Message> |
getMessageClass(java.lang.String name,
java.lang.String version,
boolean isExplicit)
|
java.lang.Class<? extends Segment> |
getSegmentClass(java.lang.String name,
java.lang.String version)
|
java.lang.Class<? extends Type> |
getTypeClass(java.lang.String name,
java.lang.String version)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CustomModelClassFactory()
DefaultModelClassFactory
public CustomModelClassFactory(java.lang.String packageName)
packageName
- The base package name to use.
When searching, package specified here will be appended with .[version].[structure type].
So, for instance, when looking for a v2.5 segment object, if "com.foo
" is passed in, HAPI will look in "com.foo.v25.segment.*
"
public CustomModelClassFactory(java.util.Map<java.lang.String,java.lang.String[]> map)
map
- Map of packages to include.
Keys are versions of HL7, e.g. "v25".
Values are an array of packages to search in for custom model classes.
When searching, the package name here will be appended with ".[structure type]".
So, for example, to specify a custom message type, you could create the class
foo.example.v23.message.ZRM_Z01
, and pass in the string "foo.example.v23
".
Method Detail |
---|
public java.lang.Class<? extends Message> getMessageClass(java.lang.String name, java.lang.String version, boolean isExplicit) throws HL7Exception
getMessageClass
in interface ModelClassFactory
name
- name of messageversion
- HL7 versionisExplicit
- true if the structure was specified explicitly in MSH-9-3, false if it
was inferred from MSH-9-1 and MSH-9-2. If false, a lookup may be performed to find
an alternate structure corresponding to that message type and event.
HL7Exception
- if the version if not recognized or an appropriate class can not be foundpublic java.lang.Class<? extends Group> getGroupClass(java.lang.String name, java.lang.String version) throws HL7Exception
getGroupClass
in interface ModelClassFactory
name
- name of groupversion
- HL7 version
HL7Exception
- if the version if not recognized or an appropriate class can not be foundpublic java.lang.Class<? extends Segment> getSegmentClass(java.lang.String name, java.lang.String version) throws HL7Exception
getSegmentClass
in interface ModelClassFactory
name
- name of segmentversion
- HL7 version
HL7Exception
- if the version if not recognized or an appropriate class can not be foundpublic java.lang.Class<? extends Type> getTypeClass(java.lang.String name, java.lang.String version) throws HL7Exception
getTypeClass
in interface ModelClassFactory
name
- name of typeversion
- HL7 version
HL7Exception
- if the version if not recognized or an appropriate class can not be foundprotected java.lang.Class<?> findClass(java.lang.String subpackage, java.lang.String name, java.lang.String version) throws HL7Exception
HL7Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |