Class FinTransmogrifierRepository

Namespace
Subsembly.FinTS
Assembly
Subsembly.FinTS.Core.dll

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

ICollection

Methods

Add(XmlElement)

Add the given syntax to this repository.

public void Add(XmlElement xmlSyntax)

Parameters

xmlSyntax XmlElement

Syntax 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

sOrderTag string

The 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 null is returned.

Exceptions

ArgumentNullException

The sOrderTag parameter was null.

FindTransmogrifier(string)

Find a FinTransmogrifier by its segment tag.

public FinTransmogrifier FindTransmogrifier(string sSegmentTag)

Parameters

sSegmentTag string

XML 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 null is returned.

FindTransmogrifier(string, int)

Find a FinTransmogrifier by segment type and version.

public FinTransmogrifier FindTransmogrifier(string sSegmentType, int nSegmentVersion)

Parameters

sSegmentType string

Segment type of the segment that shall be processed by the requested transmogrifier.

nSegmentVersion int

Segment 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 null is returned.

Load(Stream)

Loads an XML file with syntax descriptions from a stream into this repository.

public void Load(Stream aStream)

Parameters

aStream Stream

Readable 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

sFilename string

Syntaxfile 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

aSegment FinSegment

Segment 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

aSegment FinSegment

Segment to be transmogrified.

xmlParentNode XmlNode

Parent 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

xmlOrder XmlElement

XML 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.