📄 jcledisef.pas
字号:
procedure Disassemble; override;
procedure Assign(EDISEFElement: TEDISEFElement);
function Clone(NewParent: TEDISEFDataObject): TEDISEFElement; reintroduce;
function CloneAsSubElement(NewParent: TEDISEFDataObject): TEDISEFSubElement;
function GetTextSetsLocation: string;
procedure BindTextSets(TEXTSETS: TEDISEFTextSets);
published
property UserAttribute: string read FUserAttribute write FUserAttribute;
property Ordinal: Integer read FOrdinal write FOrdinal;
property OutOfSequenceOrdinal: Boolean read FOutOfSequenceOrdinal write FOutOfSequenceOrdinal;
property ElementId: string read FId write FId;
property ElementType: string read FElementType write FElementType;
property MinimumLength: Integer read FMinimumLength write FMinimumLength;
property MaximumLength: Integer read FMaximumLength write FMaximumLength;
property RequirementDesignator: string read FRequirementDesignator write FRequirementDesignator;
property RepeatCount: Integer read FRepeatCount write FRepeatCount;
property TextSetsLocation: string read GetTextSetsLocation;
//
property TEXTSETS: TEDISEFTextSets read FEDISEFTextSets;
end;
TEDISEFSubElement = class(TEDISEFElement)
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; override;
procedure Disassemble; override;
function Clone(NewParent: TEDISEFDataObject): TEDISEFSubElement; reintroduce;
end;
TEDISEFCompositeElement = class(TEDISEFDataObjectGroup)
private
FUserAttribute: string;
FOrdinal: Integer;
FOutOfSequenceOrdinal: Boolean;
FRequirementDesignator: string;
FRepeatCount: Integer;
FExtendedData: string;
FEDISEFTextSets: TEDISEFTextSets;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; override;
procedure Disassemble; override;
procedure Assign(CompositeElement: TEDISEFCompositeElement);
function Clone(NewParent: TEDISEFDataObject): TEDISEFCompositeElement; reintroduce;
function GetElementObjectList: TObjectList;
procedure AssignElementOrdinals;
function GetTextSetsLocation: string;
procedure BindTextSets(TEXTSETS: TEDISEFTextSets);
function AddSubElement: TEDISEFSubElement;
function AppendSubElement(SubElement: TEDISEFSubElement): TEDISEFSubElement;
function ExtractSubElement(SubElement: TEDISEFSubElement): TEDISEFSubElement;
procedure DeleteSubElement(SubElement: TEDISEFSubElement);
function InsertSubElement(BeforeObject: TEDISEFDataObject): TEDISEFSubElement; overload;
function InsertSubElement(SubElement: TEDISEFSubElement;
BeforeObject: TEDISEFDataObject): TEDISEFSubElement; overload;
function AddRepeatingPattern: TEDISEFRepeatingPattern;
function AppendRepeatingPattern(
RepeatingPattern: TEDISEFRepeatingPattern): TEDISEFRepeatingPattern;
function ExtractRepeatingPattern(
RepeatingPattern: TEDISEFRepeatingPattern): TEDISEFRepeatingPattern;
procedure DeleteRepeatingPattern(
RepeatingPattern: TEDISEFRepeatingPattern);
function InsertRepeatingPattern(
BeforeObject: TEDISEFDataObject): TEDISEFRepeatingPattern; overload;
function InsertRepeatingPattern(RepeatingPattern: TEDISEFRepeatingPattern;
BeforeObject: TEDISEFDataObject): TEDISEFRepeatingPattern; overload;
published
property UserAttribute: string read FUserAttribute write FUserAttribute;
property Ordinal: Integer read FOrdinal write FOrdinal;
property OutOfSequenceOrdinal: Boolean read FOutOfSequenceOrdinal write FOutOfSequenceOrdinal;
property CompositeElementId: string read FId write FId;
property RequirementDesignator: string read FRequirementDesignator write FRequirementDesignator;
property RepeatCount: Integer read FRepeatCount write FRepeatCount;
property Elements: TEDISEFDataObjectList read FEDISEFDataObjects;
property TextSetsLocation: string read GetTextSetsLocation;
//
property TEXTSETS: TEDISEFTextSets read FEDISEFTextSets;
end;
// EDI SEF Segment
TEDISEFSegment = class(TEDISEFDataObjectGroup)
private
FUserAttribute: string;
FPosition: Integer;
FPositionIncrement: Integer;
FResetPositionInc: Boolean;
FOrdinal: Integer;
FOutOfSequenceOrdinal: Boolean;
FRequirementDesignator: string;
FMaximumUse: Integer;
FOwnerLoopId: string;
FParentLoopId: string;
FParentSet: TEDISEFSet;
FParentTable: TEDISEFTable;
FEDISEFTextSets: TEDISEFTextSets;
FMaskNumber: Integer;
FMaskNumberSpecified: Boolean;
FExtendedData: string;
function GetOwnerLoopId: string;
function GetParentLoopId: string;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; override;
procedure Disassemble; override;
procedure Assign(Segment: TEDISEFSegment);
function Clone(NewParent: TEDISEFDataObject): TEDISEFSegment; reintroduce;
function GetElementObjectList: TObjectList;
procedure AssignElementOrdinals;
procedure BindElementTextSets;
function GetTextSetsLocation: string;
procedure BindTextSets(TEXTSETS: TEDISEFTextSets);
function AddElement: TEDISEFElement;
function AppendElement(Element: TEDISEFElement): TEDISEFElement;
function ExtractElement(Element: TEDISEFElement): TEDISEFElement;
procedure DeleteElement(Element: TEDISEFElement);
function InsertElement(BeforeObject: TEDISEFDataObject): TEDISEFElement; overload;
function InsertElement(Element: TEDISEFElement;
BeforeObject: TEDISEFDataObject): TEDISEFElement; overload;
function AddCompositeElement: TEDISEFCompositeElement;
function AppendCompositeElement(
CompositeElement: TEDISEFCompositeElement): TEDISEFCompositeElement;
function ExtractCompositeElement(
CompositeElement: TEDISEFCompositeElement): TEDISEFCompositeElement;
procedure DeleteCompositeElement(
CompositeElement: TEDISEFCompositeElement);
function InsertCompositeElement(
BeforeObject: TEDISEFDataObject): TEDISEFCompositeElement; overload;
function InsertCompositeElement(CompositeElement: TEDISEFCompositeElement;
BeforeObject: TEDISEFDataObject): TEDISEFCompositeElement; overload;
function AddRepeatingPattern: TEDISEFRepeatingPattern;
function AppendRepeatingPattern(
RepeatingPattern: TEDISEFRepeatingPattern): TEDISEFRepeatingPattern;
function ExtractRepeatingPattern(
RepeatingPattern: TEDISEFRepeatingPattern): TEDISEFRepeatingPattern;
procedure DeleteRepeatingPattern(
RepeatingPattern: TEDISEFRepeatingPattern);
function InsertRepeatingPattern(
BeforeObject: TEDISEFDataObject): TEDISEFRepeatingPattern; overload;
function InsertRepeatingPattern(RepeatingPattern: TEDISEFRepeatingPattern;
BeforeObject: TEDISEFDataObject): TEDISEFRepeatingPattern; overload;
published
property UserAttribute: string read FUserAttribute write FUserAttribute;
property Position: Integer read FPosition write FPosition;
property PositionIncrement: Integer read FPositionIncrement write FPositionIncrement;
property ResetPositionInc: Boolean read FResetPositionInc write FResetPositionInc;
property Ordinal: Integer read FOrdinal write FOrdinal;
property OutOfSequenceOrdinal: Boolean read FOutOfSequenceOrdinal write FOutOfSequenceOrdinal;
property SegmentId: string read FId write FId;
property RequirementDesignator: string read FRequirementDesignator write FRequirementDesignator;
property MaximumUse: Integer read FMaximumUse write FMaximumUse;
property Elements: TEDISEFDataObjectList read FEDISEFDataObjects;
property OwnerLoopId: string read GetOwnerLoopId;
property ParentLoopId: string read GetParentLoopId;
property TextSetsLocation: string read GetTextSetsLocation;
property ParentSet: TEDISEFSet read FParentSet;
property ParentTable: TEDISEFTable read FParentTable;
//
property TEXTSETS: TEDISEFTextSets read FEDISEFTextSets;
end;
// EDI SEF Loop
TEDISEFLoop = class(TEDISEFDataObjectGroup)
private
FMaximumRepeat: Integer;
function GetParentLoopId: string;
function GetParentSet: TEDISEFSet;
function GetParentTable: TEDISEFTable;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; override;
procedure Disassemble; override;
function Clone(NewParent: TEDISEFDataObject): TEDISEFLoop; reintroduce;
function AddSegment: TEDISEFSegment;
function AppendSegment(Segment: TEDISEFSegment): TEDISEFSegment;
function ExtractSegment(Segment: TEDISEFSegment): TEDISEFSegment;
procedure DeleteSegment(Segment: TEDISEFSegment);
function InsertSegment(BeforeObject: TEDISEFDataObject): TEDISEFSegment; overload;
function InsertSegment(Segment: TEDISEFSegment;
BeforeObject: TEDISEFDataObject): TEDISEFSegment; overload;
function AddLoop: TEDISEFLoop;
function AppendLoop(Loop: TEDISEFLoop): TEDISEFLoop;
function ExtractLoop(Loop: TEDISEFLoop): TEDISEFLoop;
procedure DeleteLoop(Loop: TEDISEFLoop);
function InsertLoop(BeforeObject: TEDISEFDataObject): TEDISEFLoop; overload;
function InsertLoop(Loop: TEDISEFLoop;
BeforeObject: TEDISEFDataObject): TEDISEFLoop; overload;
published
property LoopId: string read FId write FId;
property MaximumRepeat: Integer read FMaximumRepeat write FMaximumRepeat;
property ParentLoopId: string read GetParentLoopId;
property ParentSet: TEDISEFSet read GetParentSet;
property ParentTable: TEDISEFTable read GetParentTable;
end;
// EDI SEF Table
TEDISEFTable = class(TEDISEFDataObjectGroup)
private
function GetSEFSet: TEDISEFSet;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; override;
procedure Disassemble; override;
function Clone(NewParent: TEDISEFDataObject): TEDISEFTable; reintroduce;
function AddSegment: TEDISEFSegment;
function AppendSegment(Segment: TEDISEFSegment): TEDISEFSegment;
function ExtractSegment(Segment: TEDISEFSegment): TEDISEFSegment;
procedure DeleteSegment(Segment: TEDISEFSegment);
function InsertSegment(BeforeObject: TEDISEFDataObject): TEDISEFSegment; overload;
function InsertSegment(Segment: TEDISEFSegment;
BeforeObject: TEDISEFDataObject): TEDISEFSegment; overload;
function AddLoop: TEDISEFLoop;
function AppendLoop(Loop: TEDISEFLoop): TEDISEFLoop;
function ExtractLoop(Loop: TEDISEFLoop): TEDISEFLoop;
procedure DeleteLoop(Loop: TEDISEFLoop);
function InsertLoop(BeforeObject: TEDISEFDataObject): TEDISEFLoop; overload;
function InsertLoop(Loop: TEDISEFLoop;
BeforeObject: TEDISEFDataObject): TEDISEFLoop; overload;
published
property SEFSet: TEDISEFSet read GetSEFSet;
end;
// EDI SEF Set
TEDISEFSet = class(TEDISEFDataObjectGroup)
private
FEDISEFTextSets: TEDISEFTextSets;
function GetEDISEFTable(Index: Integer): TEDISEFTable;
procedure BuildSegmentObjectListFromLoop(ObjectList: TObjectList; Loop: TEDISEFLoop);
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
function Assemble: string; override;
procedure Disassemble; override;
function Clone(NewParent: TEDISEFDataObject): TEDISEFSet; reintroduce;
function GetSegmentObjectList: TObjectList;
procedure AssignSegmentOrdinals;
procedure AssignSegmentPositions;
procedure BindSegmentTextSets;
function GetTextSetsLocation: string;
procedure BindTextSets(TEXTSETS: TEDISEFTextSets);
function AddTable: TEDISEFTable;
function AppendTable(Table: TEDISEFTable): TEDISEFTable;
function ExtractTable(Table: TEDISEFTable): TEDISEFTable;
procedure DeleteTable(Table: TEDISEFTable);
function InsertTable(BeforeTable: TEDISEFTable): TEDISEFTable; overload;
function InsertTable(Table, BeforeTable: TEDISEFTable): TEDISEFTable; overload;
property Table[Index: Integer]: TEDISEFTable read GetEDISEFTable;
published
property Tables: TEDISEFDataObjectList read FEDISEFDataObjects;
property TextSetsLocation: string read GetTextSetsLocation;
//
property TEXTSETS: TEDISEFTextSets read FEDISEFTextSets;
end;
// EDI SEF File
TEDISEFFile = class(TEDISEFDataObject)
private
FFileName: string;
FEDISEFTextSets: TEDISEFTextSets;
FEDISEFCodesList: TStringList;
FEDISEFElms: TEDISEFDataObjectList;
FEDISEFComs: TEDISEFDataObjectList;
FEDISEFSegs: TEDISEFDataObjectList;
FEDISEFSets: TEDISEFDataObjectList;
FEDISEFStd: TStringList;
FEDISEFIni: TStringList;
FEDISEFVer: string;
procedure ParseTextSets;
procedure ParseCodes;
procedure ParseELMS;
procedure ParseCOMS;
procedure ParseSEGS;
procedure ParseSETS;
procedure ParseSTD;
procedure ParseINI;
procedure ParseVER;
// EDI JCL SEF Extensions
//procedure ParseELMSExt;
//procedure ParseCOMSExt;
//procedure ParseSEGSExt;
//procedure ParseSETSExt;
function GetEDISEFCodesList: TStrings;
function GetEDISEFStd: TStrings;
function GetEDISEFIni: TStrings;
public
constructor Create(Parent: TEDISEFDataObject); reintroduce;
destructor Destroy; override;
procedure LoadFromFile; overload;
procedure LoadFromFile(const FileName: string); overload;
procedure SaveToFile; overload;
procedure SaveToFile(const FileName: string); overload;
procedure Unload;
function Assemble: string; override;
procedure Disassemble; override;
function Clone(NewParent: TEDISEFDataObject): TEDISEFFile; reintroduce;
published
property FileName: string read FFileName write FFileName;
property Codes: TStrings read GetEDISEFCodesList;
property ELMS: TEDISEFDataObjectList read FEDISEFElms;
property COMS: TEDISEFDataObjectList read FEDISEFComs;
property SEGS: TEDISEFDataObjectList read FEDISEFSegs;
property SETS: TEDISEFDataObjectList read FEDISEFSets;
property STD: TStrings read GetEDISEFStd;
property INI: TStrings read GetEDISEFIni;
property VER: string read FEDISEFVer write FEDISEFVer;
//
property TEXTSETS: TEDISEFTextSets read FEDISEFTextSets;
end;
// Procedures
function GetEDISEFUserAttributeDescription(
Attribute: TEDISEFComsUserAttributes): string; overload;
function GetEDISEFUserAttributeDescription(Attribute: string): string; overload;
procedure ParseELMSDataOfELMSDefinition(Data: string; Element: TEDISEFElement);
function CombineELMSDataOfELMSDefinition(Element: TEDISEFElement): string;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -