Class FinTransmogrifierRepository
The FinTransmogrifierRepository is a container for FinTransmogrifier instances.
public class FinTransmogrifierRepository
- Inheritance
-
FinTransmogrifierRepository
- Inherited Members
Remarks
The FinTransmogrifierRepository maintains two hashtables that enable quick lookup of FinTransmogrifier instances by the Segment Tag name, or by the Segment Type (Segmentkennung) and Segment Version.
Access to the FinTransmogrifierRepository is not synchronized (thread safe)! This should not be a problem, because multiple simultaneous look ups are thread safe. Thus, if the FinTransmogrifierRepository is loaded by a single thread at startup and subsequently there are only lookup accesses everything is OK.
Constructors
FinTransmogrifierRepository()
Creates an all empty FinTransmogrifierRepository.
public FinTransmogrifierRepository()
Properties
Transmogrifiers
Provides access to the FinTransmogrifier collection of this repository.
public ICollection Transmogrifiers { get; }
Property Value
Methods
Add(XmlElement)
Add the given syntax to this repository.
public void Add(XmlElement xmlSyntax)
Parameters
xmlSyntaxXmlElementSyntax to be added.
FindSegmentType(string)
Determines the segment type for a particular order tag based on the available FinTransmogrifier instances of this repository.
public string FindSegmentType(string sOrderTag)
Parameters
sOrderTagstringThe base order tag without version number and without _Req suffix. For example, "SingRemitt" is the base order tag for a single remittance. Must not be null.
Returns
- string
If an FinTransmogrifier in this repository is found that handles XML orders with the given order tag, then its SegmentType property is returned. If no matching FinTransmogrifier is found, then
nullis returned.
Exceptions
- ArgumentNullException
The sOrderTag parameter was null.
FindTransmogrifier(string)
Find a FinTransmogrifier by its segment tag.
public FinTransmogrifier FindTransmogrifier(string sSegmentTag)
Parameters
sSegmentTagstringXML segment tag of the segment that shall be processed by the requested transmogrifier. For example, "SingRemitt_5_Req" is the segment tag for a single remittance based on segment version 5.
Returns
- FinTransmogrifier
If this repository contains a FinTransmogrifier that processes the requested segment tag, then its reference is returned. Otherwise
nullis returned.
FindTransmogrifier(string, int)
Find a FinTransmogrifier by segment type and version.
public FinTransmogrifier FindTransmogrifier(string sSegmentType, int nSegmentVersion)
Parameters
sSegmentTypestringSegment type of the segment that shall be processed by the requested transmogrifier.
nSegmentVersionintSegment version of the segment that shall be processed by the requested transmogrifier.
Returns
- FinTransmogrifier
If this repository contains a FinTransmogrifier that processes the requested segment type and version, then its reference is returned. Otherwise
nullis returned.
Load(Stream)
Loads an XML file with syntax descriptions from a stream into this repository.
public void Load(Stream aStream)
Parameters
aStreamStreamReadable stream that provides the XML file.
Remarks
The loaded XML file must contain an <all> root node that contains all the syntax description <seg> nodes.
The loaded syntax descriptions are added to the repository. Any previously existing entries are still maintained. If a syntax is added with a Segment Tag or Segment Type and Segment Version that already exists in this repository, then it will be replaced with the loaded syntax.
Exceptions
- XmlException
The given file was not a valid XML document.
- ArgumentNullException
The parameter was
null.
Load(string)
Loads an XML file with syntax descriptions into this repository.
public void Load(string sFilename)
Parameters
sFilenamestringSyntaxfile to be loaded.
Remarks
The loaded XML file must contain an <all> root node that contains all the syntax description <seg> nodes.
The loaded syntax descriptions are added to the repository. Any previously existing entries are still maintained. If a syntax is added with a Segment Tag or Segment Type and Segment Version that already exists in this repository, then it will be replaced with the loaded syntax.
Exceptions
- XmlException
The given file was not a valid XML document.
- FileNotFoundException
The given filename did not exist.
- ArgumentNullException
The parameter was
null.
Transmogrify(FinSegment)
Transmogrifies a segment using a matching transmogrifier from this repository.
public XmlDocument Transmogrify(FinSegment aSegment)
Parameters
aSegmentFinSegmentSegment to be transmogrified.
Returns
- XmlDocument
XML data that resulted by transmogrifying the segment.
Exceptions
- ArgumentNullException
Parameter aSegment was
null.- InvalidOperationException
No matching transmogrifier could be found in this repository.
Transmogrify(FinSegment, XmlNode)
Transmogrifies a segment using a matching transmogrifier from this repository.
public void Transmogrify(FinSegment aSegment, XmlNode xmlParentNode)
Parameters
aSegmentFinSegmentSegment to be transmogrified.
xmlParentNodeXmlNodeParent node that shall receive the transmogrified segment data nodes.
Exceptions
- ArgumentNullException
Parameter aSegment or xmlParentNode was
null.- InvalidOperationException
No matching transmogrifier could be found in this repository.
Transmogrify(XmlElement)
Transmogrifies a XML order using a matching transmogrifier from this repository.
public FinSegment Transmogrify(XmlElement xmlOrder)
Parameters
xmlOrderXmlElementXML order to be transmogrified.
Returns
- FinSegment
FinSegment that resulted by transmogrifying the XML order.
Exceptions
- ArgumentNullException
Parameter xmlOrder was
null.- InvalidOperationException
No matching transmogrifier could be found in this repository.