Skip to content

Commit

Permalink
wip: edifact post-UNA header handling
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Edgar <[email protected]>
  • Loading branch information
MikeEdgar committed Sep 9, 2023
1 parent 0dc4653 commit 3195a45
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ public boolean isServiceAdviceSegment(CharSequence tag) {

@Override
public State getTagSearchState() {
if (isServiceAdviceSegment(this.headerTag)) {
return State.HEADER_EDIFACT_UNB_SEARCH;
}
// if (isServiceAdviceSegment(this.headerTag)) {
// return State.HEADER_EDIFACT_UNB_SEARCH;
// }
return State.TAG_SEARCH;
}

Expand Down
26 changes: 13 additions & 13 deletions src/main/java/io/xlate/edi/internal/stream/tokenization/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ private static final class Category {
private static final State HE = State.HEADER_ELEMENT_END;
private static final State HZ = State.HEADER_SEGMENT_END;

private static final State B0 = State.HEADER_EDIFACT_UNB_SEARCH;
private static final State B1 = State.HEADER_EDIFACT_UNB_1;
private static final State B2 = State.HEADER_EDIFACT_UNB_2;
private static final State B3 = State.HEADER_EDIFACT_UNB_3;
private static final State BB = State.HEADER_SEGMENT_BEGIN;
// private static final State B0 = State.HEADER_EDIFACT_UNB_SEARCH;
// private static final State B1 = State.HEADER_EDIFACT_UNB_1;
// private static final State B2 = State.HEADER_EDIFACT_UNB_2;
// private static final State B3 = State.HEADER_EDIFACT_UNB_3;
// private static final State BB = State.HEADER_SEGMENT_BEGIN;

private static final State TS = State.TAG_SEARCH;
private static final State T1 = State.TAG_1;
Expand Down Expand Up @@ -237,10 +237,10 @@ private static final class Category {
private static final State[] FROM_EDIFACT_7 = { __, T2, T2, T2, T2, T2, U8, T2, T2, T2, T2, T2, T2, __, _1, __, __, __, __, __, __, __, __ };
private static final State[] FROM_EDIFACT_8 = { __, T3, T3, T3, T3, T3, T3, T3, T3, T3, T3, U9, T3, __, SB, __, __, __, __, __, __, __, __ };
private static final State[] FROM_EDIFACT_9 = { __, __, __, __, __, __, __, __, __, __, __, __, __, __, TB, __, __, __, __, __, __, __, __ };
private static final State[] FROM_EDIFACT_UNB_0 = { B0, __, __, __, __, __, __, __, B1, B1, __, __, __, __, __, __, __, __, B0, __, __, __, __ };
private static final State[] FROM_EDIFACT_UNB_1 = { __, __, __, __, __, __, B2, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __ };
private static final State[] FROM_EDIFACT_UNB_2 = { __, __, B3, __, __, __, __, __, __, __, __, __, __, __, BB, __, __, __, __, __, __, __, __ };
private static final State[] FROM_EDIFACT_UNB_3 = { __, __, __, __, __, __, __, __, __, __, __, __, __, __, BB, __, __, __, __, __, __, __, __ };
// private static final State[] FROM_EDIFACT_UNB_0 = { B0, __, __, __, __, __, __, __, B1, B1, __, __, __, __, __, __, __, __, B0, __, __, __, __ };
// private static final State[] FROM_EDIFACT_UNB_1 = { __, __, __, __, __, __, B2, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __ };
// private static final State[] FROM_EDIFACT_UNB_2 = { __, __, B3, __, __, __, __, __, __, __, __, __, __, __, BB, __, __, __, __, __, __, __, __ };
// private static final State[] FROM_EDIFACT_UNB_3 = { __, __, __, __, __, __, __, __, __, __, __, __, __, __, BB, __, __, __, __, __, __, __, __ };

/*-
* SPACE SEGMT CMPST RELSE CNTRL INVLD *
Expand Down Expand Up @@ -297,10 +297,10 @@ private static final class Category {
FROM_EDIFACT_7,
FROM_EDIFACT_8,
FROM_EDIFACT_9,
FROM_EDIFACT_UNB_0,
FROM_EDIFACT_UNB_1,
FROM_EDIFACT_UNB_2,
FROM_EDIFACT_UNB_3
// FROM_EDIFACT_UNB_0,
// FROM_EDIFACT_UNB_1,
// FROM_EDIFACT_UNB_2,
// FROM_EDIFACT_UNB_3
};

private static final State[][] TRANSITION_TRADACOMS = {
Expand Down

0 comments on commit 3195a45

Please sign in to comment.