public class CustomModelClassFactory extends Object implements ModelClassFactory
| Constructor and Description |
|---|
CustomModelClassFactory()
Constructor which just delegated to
DefaultModelClassFactory |
CustomModelClassFactory(Map<String,String[]> map)
Constructor
|
CustomModelClassFactory(String packageName)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
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)
|
Class<? extends Segment> |
getSegmentClass(String name,
String version) |
Class<? extends Type> |
getTypeClass(String name,
String version) |
public CustomModelClassFactory()
DefaultModelClassFactorypublic 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".
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 foundpublic Class<? extends Group> getGroupClass(String name, String version) throws HL7Exception
getGroupClass in interface ModelClassFactoryname - name of groupversion - HL7 versionHL7Exception - if the version if not recognized or an appropriate class can not be foundpublic Class<? extends Segment> getSegmentClass(String name, String version) throws HL7Exception
getSegmentClass in interface ModelClassFactoryname - name of segmentversion - HL7 versionHL7Exception - if the version if not recognized or an appropriate class can not be foundpublic Class<? extends Type> getTypeClass(String name, String version) throws HL7Exception
getTypeClass in interface ModelClassFactoryname - name of typeversion - HL7 versionHL7Exception - if the version if not recognized or an appropriate class can not be foundprotected Class<?> findClass(String subpackage, String name, String version) throws HL7Exception
HL7Exceptionpublic 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)HL7ExceptionCopyright © 2001-2012 University Health Network. All Rights Reserved.