com.solab.iso8583.parse
Class FieldParseInfo

java.lang.Object
  extended by com.solab.iso8583.parse.FieldParseInfo

public class FieldParseInfo
extends Object

This class contains the information needed to parse a field from a message buffer.

Author:
Enrique Zamudio

Constructor Summary
FieldParseInfo(IsoType t, int len)
          Creates a new instance that parses a value of the specified type, with the specified length.
 
Method Summary
 int getLength()
          Returns the specified length for the data to be parsed.
 IsoType getType()
          Returns the data type for the data to be parsed.
<T> IsoValue<?>
parse(byte[] buf, int pos, CustomField<T> custom)
          Parses the character data from the buffer and returns the IsoValue with the correct data type in it.
<T> IsoValue<?>
parseBinary(byte[] buf, int pos, CustomField<T> custom)
          Parses binary data from the buffer, creating and returning an IsoValue of the configured type and length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldParseInfo

public FieldParseInfo(IsoType t,
                      int len)
Creates a new instance that parses a value of the specified type, with the specified length. The length is only useful for ALPHA and NUMERIC types.

Parameters:
t - The ISO type to be parsed.
len - The length of the data to be read (useful only for ALPHA and NUMERIC types).
Method Detail

getLength

public int getLength()
Returns the specified length for the data to be parsed.


getType

public IsoType getType()
Returns the data type for the data to be parsed.


parse

public <T> IsoValue<?> parse(byte[] buf,
                             int pos,
                             CustomField<T> custom)
                  throws ParseException
Parses the character data from the buffer and returns the IsoValue with the correct data type in it.

Throws:
ParseException

parseBinary

public <T> IsoValue<?> parseBinary(byte[] buf,
                                   int pos,
                                   CustomField<T> custom)
                        throws ParseException
Parses binary data from the buffer, creating and returning an IsoValue of the configured type and length.

Throws:
ParseException