X12Parser

public class X12Parser implements Parser

The class represents methods used to translate a X12 transaction represented as a file or string into an X12 object.

Author:Prasad Balan

Fields

POS_COMPOSITE_ELEMENT

public static final int POS_COMPOSITE_ELEMENT

Constant POS_COMPOSITE_ELEMENT=104

POS_ELEMENT

public static final int POS_ELEMENT

Constant POS_ELEMENT=3

POS_SEGMENT

public static final int POS_SEGMENT

Constant POS_SEGMENT=105

START_TAG

public static final String START_TAG

Constant START_TAG="ISA"

Constructors

X12Parser

public X12Parser(Cf cf)

Constructor for X12Parser.

Parameters:
  • cf – a Cf object.

Methods

doesChildLoopMatch

boolean doesChildLoopMatch(Cf parent, String[] tokens)

Checks if the segment (or line read) matches to any of the child loops configuration.

Parameters:
  • parent – Cf
  • tokens – String[] represents the segment broken into elements
Returns:

boolean

parse

public EDI parse(File fileName)

{@inheritDoc} The method takes a X12 file and converts it into a X2 object. The X12 class has methods to convert it into XML format as well as methods to modify the contents.

parse

public EDI parse(InputStream source)

The method takes a InputStream and converts it into a X2 object. The X12 class has methods to convert it into XML format as well as methods to modify the contents.

Parameters:
  • source – InputStream
Throws:
Returns:

the X12 object

parse

public EDI parse(String source)

The method takes a X12 string and converts it into a X2 object. The X12 class has methods to convert it into XML format as well as methods to modify the contents.

Parameters:
  • source – String
Throws:
Returns:

the X12 object