Skip to content

IEdiSegment

IEdiSegment is the contract implemented by EdiSegment; it extends IEdiDataElement with the additional surface needed to expose a segment's identifier and its own child data elements.

Purpose

  • Declares SegmentId, DataElements, GetElement, GetCompositeElement, and GetChildValue as the contract any segment implementation must provide, letting parser/builder code depend on the segment abstraction rather than the concrete EdiSegment class.

Context

  • Namespace: SAIF.Common.Files.Edi
  • Assembly/package: SAIF.Framework.Common.Files
  • Extends: IEdiDataElement

Public members

Member Signature Purpose
SegmentId string SegmentId { get; set; } The X12 segment tag (e.g. "ISA", "GS", "ST") identifying the segment's type (BR-020).
DataElements IEnumerable<IEdiDataElement> DataElements { get; } The ordered collection of data elements that make up this segment.
GetElement IEdiDataElement GetElement(int index) Returns the data element at the given ordinal index, or null if none exists.
GetCompositeElement IEdiCompositeDataElement GetCompositeElement(int index) Returns the element at index as a composite data element, re-parsing it if necessary.
GetChildValue string GetChildValue(int index) Returns the raw text Value of the element at index, or string.Empty if none exists.

Inherited public members

Members in this section are inherited from IEdiDataElement (and, transitively, IEdiElement) in SAIF.Framework.Common.Files. They are available on this type through inheritance.

Member Signature Purpose Origin
Index int Index { get; set; } The segment's ordinal position within its parent file's flat segment list. SAIF.Framework.Common.Files — IEdiElement
Value string Value { get; set; } The raw text value of the segment as a whole element. SAIF.Framework.Common.Files — IEdiElement
Type ElementType Type { get; } Identifies the concrete element kind (ElementType.Segment for conforming implementations). SAIF.Framework.Common.Files — IEdiElement

Sources

  • Common\SAIF.Common.Files\Edi\IEdiSegment.cs