|
||||||||||
| 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(Map<String,String[]> map)
Constructor |
|
CustomModelClassFactory(String packageName)
Constructor |
|
| Method Summary | |
|---|---|
protected Class<?> |
findClass(String subpackage,
String name,
String version)
Finds appropriate classes to be loaded for the given structure/type |
Class<? extends Group> |
getGroupClass(String name,
String version)
|
Class<? extends Message> |
getMessageClass(String name,
String version,
boolean isExplicit)
|
Class<? extends Message> |
getMessageClassInASpecificPackage(String theName,
String theVersion,
boolean theIsExplicit,
String thePackageName)
Delegates calls to DefaultModelClassFactory.getMessageClassInASpecificPackage(String, String, boolean, String) |
Class<? extends Segment> |
getSegmentClass(String name,
String version)
|
Class<? extends Type> |
getTypeClass(String name,
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(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(Map<String,String[]> map)
map - Map of packages to include.
Keys are versions of HL7, e.g. "2.5".
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 Class<? extends Message> getMessageClass(String name,
String version,
boolean isExplicit)
throws HL7Exception
getMessageClass in interface ModelClassFactoryname - 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 found
public Class<? extends Group> getGroupClass(String name,
String version)
throws HL7Exception
getGroupClass in interface ModelClassFactoryname - name of groupversion - HL7 version
HL7Exception - if the version if not recognized or an appropriate class can not be found
public Class<? extends Segment> getSegmentClass(String name,
String version)
throws HL7Exception
getSegmentClass in interface ModelClassFactoryname - name of segmentversion - HL7 version
HL7Exception - if the version if not recognized or an appropriate class can not be found
public Class<? extends Type> getTypeClass(String name,
String version)
throws HL7Exception
getTypeClass in interface ModelClassFactoryname - name of typeversion - HL7 version
HL7Exception - if the version if not recognized or an appropriate class can not be found
protected Class<?> findClass(String subpackage,
String name,
String version)
throws HL7Exception
HL7Exception
public Class<? extends Message> getMessageClassInASpecificPackage(String theName,
String theVersion,
boolean theIsExplicit,
String thePackageName)
throws HL7Exception
DefaultModelClassFactory.getMessageClassInASpecificPackage(String, String, boolean, String)
getMessageClassInASpecificPackage in interface ModelClassFactorytheName - The message structure type (e.g. "ADT_A01")theVersion - The HL7 version (e.g. "2.3.1")theIsExplicit - If false, the message structure is looked up using Parser.getMessageStructureForEvent(String, String) and converted to the appropriate structure type. For example, "ADT_A04" would be converted to "ADT_A01" because the A04 trigger uses the A01 message structure according to HL7.thePackageName - The package name to use. Note that if the message type can't be found in this package, HAPI will return the standard type returned by ModelClassFactory.getMessageClass(String, String, boolean)
HL7Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||