com.mirth.connect.server.userutil
Class SerializerFactory

java.lang.Object
  extended by com.mirth.connect.server.userutil.SerializerFactory

public class SerializerFactory
extends java.lang.Object

Used to create a serializer for a specific data type for conversion to and from XML.


Method Summary
static java.util.Map<java.lang.String,java.lang.Object> getDefaultDeserializationProperties(java.lang.String dataType)
          Returns a map of default properties used to customize how deserialization from XML to the data type is performed.
static java.util.Map<java.lang.String,java.lang.Object> getDefaultSerializationProperties(java.lang.String dataType)
          Returns a map of default properties used to customize how serialization from the data type to XML is performed.
static com.mirth.connect.model.converters.IXMLSerializer getEDISerializer(java.lang.String segmentDelim, java.lang.String elementDelim, java.lang.String subelementDelim)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.
static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer()
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.
static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser, boolean useStrictValidation)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.
static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser, boolean useStrictValidation, boolean handleRepetitions)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.
static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser, boolean useStrictValidation, boolean handleRepetitions, boolean convertLFtoCR)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.
static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser, boolean useStrictValidation, boolean handleRepetitions, boolean convertLFtoCR, boolean handleSubcomponents)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.
static com.mirth.connect.model.converters.IXMLSerializer getNCPDPSerializer(java.lang.String segmentDelim, java.lang.String groupDelim, java.lang.String fieldDelim)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.
static com.mirth.connect.model.converters.IXMLSerializer getNCPDPSerializer(java.lang.String segmentDelim, java.lang.String groupDelim, java.lang.String fieldDelim, boolean useStrictValidation)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.
static com.mirth.connect.model.converters.IXMLSerializer getSerializer(java.lang.String dataType)
          Returns a serializer (with toXML and fromXML methods) for a given data type.
static com.mirth.connect.model.converters.IXMLSerializer getSerializer(java.lang.String dataType, java.util.Map<java.lang.String,java.lang.Object> serializationPropertiesMap, java.util.Map<java.lang.String,java.lang.Object> deserializationPropertiesMap)
          Returns a serializer (with toXML and fromXML methods) for a given data type and properties.
static com.mirth.connect.model.converters.IXMLSerializer getX12Serializer(boolean inferDelimiters)
          Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSerializer

public static com.mirth.connect.model.converters.IXMLSerializer getSerializer(java.lang.String dataType)
Returns a serializer (with toXML and fromXML methods) for a given data type. Any serialization or deserialization properties will be left as the default values.

Parameters:
dataType - The plugin point (e.g. "HL7V2") of the data type to create the serializer for.
Returns:
The instantiated IXMLSerializer object.

getSerializer

public static com.mirth.connect.model.converters.IXMLSerializer getSerializer(java.lang.String dataType,
                                                                              java.util.Map<java.lang.String,java.lang.Object> serializationPropertiesMap,
                                                                              java.util.Map<java.lang.String,java.lang.Object> deserializationPropertiesMap)
Returns a serializer (with toXML and fromXML methods) for a given data type and properties.

Parameters:
dataType - The plugin point (e.g. "HL7V2") of the data type to create the serializer for.
serializationPropertiesMap - A Map of properties used to customize how serialization from the data type to XML is performed.
deserializationPropertiesMap - A Map of properties used to customize how deserialization from XML to the data type is performed.
Returns:
The instantiated IXMLSerializer object.

getDefaultSerializationProperties

public static java.util.Map<java.lang.String,java.lang.Object> getDefaultSerializationProperties(java.lang.String dataType)
Returns a map of default properties used to customize how serialization from the data type to XML is performed.

Parameters:
dataType - The plugin point (e.g. "HL7V2") of the data type to get default properties for.
Returns:
The map of default serialization properties.

getDefaultDeserializationProperties

public static java.util.Map<java.lang.String,java.lang.Object> getDefaultDeserializationProperties(java.lang.String dataType)
Returns a map of default properties used to customize how deserialization from XML to the data type is performed.

Parameters:
dataType - The plugin point (e.g. "HL7V2") of the data type to get default properties for.
Returns:
The map of default deserialization properties.

getHL7Serializer

public static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser,
                                                                                 boolean useStrictValidation,
                                                                                 boolean handleRepetitions,
                                                                                 boolean convertLFtoCR,
                                                                                 boolean handleSubcomponents)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.

Returns an HL7 v2.x serializer.

Parameters:
useStrictParser - If true, messages will be parsed based upon strict HL7 specifications.
useStrictValidation - If true, messages will be validated using HL7 specifications (applies to Strict Parser only).
handleRepetitions - If true, field repetitions will be parsed (applies to Non-Strict Parser only).
convertLFtoCR - If true, line feeds (\n) will be converted to carriage returns (\r) automatically (applies to Non-Strict Parser only).
handleSubcomponents - If true, subcomponents will be parsed (applies to Non-Strict Parser only).
Returns:
The instantiated IXMLSerializer object.

getHL7Serializer

public static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser,
                                                                                 boolean useStrictValidation,
                                                                                 boolean handleRepetitions,
                                                                                 boolean convertLFtoCR)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.

Returns an HL7 v2.x serializer.

Parameters:
useStrictParser - If true, messages will be parsed based upon strict HL7 specifications.
useStrictValidation - If true, messages will be validated using HL7 specifications (applies to Strict Parser only).
handleRepetitions - If true, field repetitions will be parsed (applies to Non-Strict Parser only).
convertLFtoCR - If true, line feeds (\n) will be converted to carriage returns (\r) automatically (applies to Non-Strict Parser only).
Returns:
The instantiated IXMLSerializer object.

getHL7Serializer

public static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser,
                                                                                 boolean useStrictValidation,
                                                                                 boolean handleRepetitions)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.

Returns an HL7 v2.x serializer.

Parameters:
useStrictParser - If true, messages will be parsed based upon strict HL7 specifications.
useStrictValidation - If true, messages will be validated using HL7 specifications (applies to Strict Parser only).
handleRepetitions - If true, field repetitions will be parsed (applies to Non-Strict Parser only).
Returns:
The instantiated IXMLSerializer object.

getHL7Serializer

public static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer(boolean useStrictParser,
                                                                                 boolean useStrictValidation)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.

Returns an HL7 v2.x serializer.

Parameters:
useStrictParser - If true, messages will be parsed based upon strict HL7 specifications.
useStrictValidation - If true, messages will be validated using HL7 specifications (applies to Strict Parser only).
Returns:
The instantiated IXMLSerializer object.

getHL7Serializer

public static com.mirth.connect.model.converters.IXMLSerializer getHL7Serializer()
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead. The new method will now strip namespaces by default unless the 'stripNamespaces' property is set to false.

Returns an HL7 v2.x serializer.

Returns:
The instantiated IXMLSerializer object.

getX12Serializer

public static com.mirth.connect.model.converters.IXMLSerializer getX12Serializer(boolean inferDelimiters)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.

Returns an EDI / X12 serializer.

Parameters:
inferDelimiters - This property only applies to X12 messages. If checked, the delimiters are inferred from the incoming message and the delimiter properties will not be used.
Returns:
The instantiated IXMLSerializer object.

getEDISerializer

public static com.mirth.connect.model.converters.IXMLSerializer getEDISerializer(java.lang.String segmentDelim,
                                                                                 java.lang.String elementDelim,
                                                                                 java.lang.String subelementDelim)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.

Returns an EDI / X12 serializer.

Parameters:
segmentDelim - Characters that delimit the segments in the message.
elementDelim - Characters that delimit the elements in the message.
subelementDelim - Characters that delimit the subelements in the message.
Returns:
The instantiated IXMLSerializer object.

getNCPDPSerializer

public static com.mirth.connect.model.converters.IXMLSerializer getNCPDPSerializer(java.lang.String segmentDelim,
                                                                                   java.lang.String groupDelim,
                                                                                   java.lang.String fieldDelim,
                                                                                   boolean useStrictValidation)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.

Returns an NCPDP serializer.

Parameters:
segmentDelim - Characters that delimit the segments in the message.
groupDelim - Characters that delimit the groups in the message.
fieldDelim - Characters that delimit the fields in the message.
useStrictValidation - Validates the NCPDP message against a schema.
Returns:
The instantiated IXMLSerializer object.

getNCPDPSerializer

public static com.mirth.connect.model.converters.IXMLSerializer getNCPDPSerializer(java.lang.String segmentDelim,
                                                                                   java.lang.String groupDelim,
                                                                                   java.lang.String fieldDelim)
Deprecated. This method is deprecated and will soon be removed. Please use getSerializer(dataType, serializationPropertiesMap, deserializationPropertiesMap) instead.

Returns an NCPDP serializer.

Parameters:
segmentDelim - Characters that delimit the segments in the message.
groupDelim - Characters that delimit the groups in the message.
fieldDelim - Characters that delimit the fields in the message.
Returns:
The instantiated IXMLSerializer object.