edu.mayo.informatics.lexgrid.convert.utility.loaderPreferences.loaders
Class HL7PreferenceLoader
java.lang.Object
edu.mayo.informatics.lexgrid.convert.utility.loaderPreferences.loaders.BasePreferenceLoader
edu.mayo.informatics.lexgrid.convert.utility.loaderPreferences.loaders.HL7PreferenceLoader
- All Implemented Interfaces:
- PreferenceLoader
public class HL7PreferenceLoader
- extends BasePreferenceLoader
- implements PreferenceLoader
Class to load HL7 loader preferences from an XML file
- Author:
- Kevin Peterson
Constructor Summary |
HL7PreferenceLoader(java.net.URI HL7Preferences)
Constructor for creating an HL7PreferenceLoader. |
HL7PreferenceLoader(java.net.URI HL7Preferences,
boolean validate)
Constructor for creating an HL7PreferenceLoader. |
Method Summary |
LoaderPreferences |
load()
Returns a generic Preferences object. |
boolean |
validate()
Validates an XML preferences file against its corresponding XSD. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HL7PreferenceLoader
public HL7PreferenceLoader(java.net.URI HL7Preferences,
boolean validate)
throws LgConvertException
- Constructor for creating an HL7PreferenceLoader. This class is used to
populate specific OWL constants that will be used during the load
- Parameters:
HL7Preferences
- The location of the XML preferences file.validate
- Whether or not to validate the preferences XML against the
associated XML schema. This will look for invalid, extra, or
missing values. Note that even if this is 'false', the XML
will be structurally validated. This means that even if it is
not validated against the schema, it will still be validated
to ensure it is a well-structured XML file.
- Throws:
LgConvertException
- Thrown if the XML is not a valid XML file, or if 'validate'
is true this exception will be thrown if the XML does not
validate against the schema.
HL7PreferenceLoader
public HL7PreferenceLoader(java.net.URI HL7Preferences)
throws LgConvertException
- Constructor for creating an HL7PreferenceLoader. This class is used to
populate specific HL7 constants that will be used during the load.
NOTE: This will by default NOT validate the XML against its schema.
- Parameters:
HL7Preferences
- The location of the XML preferences file.
- Throws:
LgConvertException
- Thrown if the XML is not a valid XML file, or if the XML does
not validate against the schema.
validate
public boolean validate()
- Validates an XML preferences file against its corresponding XSD. If
errors are found, the exception will be logged.
- Specified by:
validate
in interface PreferenceLoader
- Returns:
- false if the XML does not validate, otherwise true.
load
public LoaderPreferences load()
throws LgConvertException
- Description copied from interface:
PreferenceLoader
- Returns a generic Preferences object. This method will NOT validate
against an XSD, but will do minimum checks to determine if the XML is
well-formed.
- Specified by:
load
in interface PreferenceLoader
- Returns:
- The generic Preferences Object. Because each loader implements
its preferences independently, this method returns a generic
Object. Use a specific loader to get each format's specific
preferences object.
- Throws:
LgConvertException