@groovy.transform.CompileStatic class EdiHandler extends java.lang.Object
Modifiers | Name | Description |
---|---|---|
static class |
EdiHandler.ElementError |
|
static enum |
EdiHandler.ElementErrorType |
|
static class |
EdiHandler.SegmentError |
|
static enum |
EdiHandler.SegmentErrorType |
Modifiers | Name | Description |
---|---|---|
protected java.util.List<java.util.Map<java.lang.String, java.lang.Object>> |
body |
|
protected java.lang.String |
bodyRootId |
|
protected ExecutionContext |
ec |
|
protected java.util.List<java.util.Map<java.lang.String, java.lang.Object>> |
envelope |
|
protected java.util.Set<java.lang.String> |
knownSegmentIds |
|
protected static org.slf4j.Logger |
logger |
|
protected java.util.List<SegmentError> |
segmentErrors |
Type | Name and description |
---|---|
java.lang.Character |
componentDelimiter |
static java.util.Map<ElementErrorType, java.lang.String> |
elementErrorX12Codes |
java.lang.Character |
elementSeparator |
char |
escapeCharacter |
java.util.Set<java.lang.String> |
noEscapeSegments |
char |
paddingChar |
java.util.Map<java.lang.String, java.util.List<java.lang.Integer>> |
segmentElementSizes |
static java.util.Map<SegmentErrorType, java.lang.String> |
segmentErrorX12Codes |
java.lang.Character |
segmentSuffix |
java.lang.Character |
segmentTerminator |
Constructor and description |
---|
EdiHandler
(ExecutionContext ec) |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
combineSegments(java.util.ArrayList<java.lang.String> segmentStringList) |
|
int |
countSegments(java.util.Map<java.lang.String, java.util.List<java.lang.Object>> ediMap) |
|
protected void |
determineSeparators(java.lang.String ediText) |
|
protected java.lang.String |
escape(java.lang.String original) |
|
protected void |
extractSegmentIds(java.util.List<java.util.Map<java.lang.String, java.lang.Object>> defList) |
|
protected void |
generateSegment(java.util.Map<java.lang.String, java.util.List<java.lang.Object>> segmentMap, java.lang.StringBuilder sb) |
|
java.lang.String |
generateText(java.util.Map<java.lang.String, java.util.List<java.lang.Object>> rootMap) Generate EDI text from the same Map/List structure created from the parse. |
|
protected java.lang.String |
getComponentRegex() |
|
protected java.lang.String |
getElementRegex() |
|
protected java.util.ArrayList<java.lang.Object> |
getSegmentElements(java.lang.String segmentString) |
|
java.util.List<SegmentError> |
getSegmentErrors() |
|
protected java.lang.String |
getSegmentId(java.lang.String segmentString) |
|
protected java.lang.String |
getSegmentRegex() |
|
EdiHandler |
loadBody(java.lang.String location) Run a Groovy script at location to get the nested List/Map file structure. |
|
EdiHandler |
loadEnvelope(java.lang.String location) Run a Groovy script at location to get the nested List/Map file envelope structure (for X12: ISA, GS, and ST segments). |
|
protected boolean |
needsEscape(char c) |
|
protected int |
parseSegment(java.util.List<java.lang.String> allSegmentStringList, int segmentIndex, java.util.Map<java.lang.String, java.util.List<java.lang.Object>> currentSegment, java.util.Map<java.lang.String, java.lang.Object> curDefMap) |
|
protected int |
parseSegments(java.util.List<java.lang.String> allSegmentStringList, int segmentIndex, java.util.Map<java.lang.String, java.util.List<java.lang.Object>> currentSegment, java.util.List<java.util.Map<java.lang.String, java.lang.Object>> levelDefList) Internal recursive method for parsing segments |
|
java.util.Map<java.lang.String, java.util.List<java.lang.Object>> |
parseText(java.lang.String ediText) Parse EDI text and return a Map containing a "elements" entry with a List of element values (each may be a String or List |
|
EdiHandler |
setChars(java.lang.Character segmentTerminator, java.lang.Character elementSeparator, java.lang.Character componentDelimiter, java.lang.Character escapeCharacter) |
|
EdiHandler |
setEdifactDefaultChars() |
|
EdiHandler |
setITradeDefaultChars() |
|
EdiHandler |
setX12DefaultChars() |
|
java.util.List<java.lang.String> |
splitMessage(java.lang.String rootHeaderId, java.lang.String rootTrailerId, java.lang.String ediText) |
|
protected java.lang.String |
unescape(java.lang.String original) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Generate EDI text from the same Map/List structure created from the parse.
Run a Groovy script at location to get the nested List/Map file structure. The segment(s) in the top-level List should be referenced in the envelope structure, ie this structure will be used under the envelope structure. These are based on Bots Grammars (http://sourceforge.net/projects/bots/files/grammars/), converted from Python to Groovy List/Map syntax (search/replace '{' to '[' and '}' to ']'), only include the structure List (script should evaluate to or return just the structure List).
Run a Groovy script at location to get the nested List/Map file envelope structure (for X12: ISA, GS, and ST segments). The QUERIES and SUBTRANSLATION entries can be removed, will be ignored. These are based on Bots Grammars (http://sourceforge.net/projects/bots/files/grammars/), converted from Python to Groovy List/Map syntax (search/replace '{' to '[' and '}' to ']'), only include the structure List (script should evaluate to or return just the structure List).
Internal recursive method for parsing segments
Parse EDI text and return a Map containing a "elements" entry with a List of element values (each may be a String
or List
Groovy Documentation