public class Field extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static SimpleDateFormat |
sdfDate |
protected static SimpleDateFormat |
sdfTime |
| Constructor and Description |
|---|
Field() |
Field(int offset,
int length) |
Field(int offset,
int length,
FieldType type) |
Field(String fieldName,
int fieldNumber,
int offset,
int length) |
Field(String fieldName,
int fieldNumber,
int offset,
int length,
FieldType type) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearBit(byte mask,
ByteArray record) |
Object |
extract(ByteArray record)
Extract a data field from a ByteArray.
|
byte |
extractAsByte(ByteArray record)
Extract a data field from a ByteArray as a byte.
|
ByteArray |
extractAsByteArray(ByteArray record)
Extract a data field from a ByteArray as a ByteArray.
|
byte[] |
extractAsBytes(ByteArray record)
Extract a data field from a ByteArray as byte[].
|
int |
extractAsInt(ByteArray record)
Extract a data field from a ByteArray as an int.
|
long |
extractAsLong(ByteArray record)
Extract a data field from a ByteArray as a long.
|
short |
extractAsShort(ByteArray record)
Extract a data field from a ByteArray as a short.
|
String |
extractAsString(ByteArray record)
Extract a data field from a ByteArray record as a String.
|
String |
extractPnsAsString(ByteArray record)
Extract a data field from a ByteArray converting from PNS to a String.
|
Date |
extractStringAsDate(ByteArray record)
Extract a data field from a ByteArray as a Date.
|
Date |
extractStringAsDate(ByteArray record,
TimeZone zone)
Extract a data field from a ByteArray as a Date.
|
int |
extractStringAsInt(ByteArray record)
Extract a data field from a ByteArray as a String and convert value to an
int.
|
long |
extractStringAsLong(ByteArray record)
Extract a data field from a ByteArray as a String and convert value to a
long.
|
OnUsField |
extractStringAsOnUsField(ByteArray record)
Extract a data field from a ByteArray as a String and convert value to an
OnusField.
|
RoutingNumber |
extractStringAsRoutingNumber(ByteArray record)
Extract a data field from a ByteArray as a String and convert value to an
RoutingNumber.
|
Date |
extractStringAsTime(ByteArray record)
Extract a data field from a ByteArray as a Date object containing only
time values.
|
Date |
extractStringAsTime(ByteArray record,
TimeZone zone)
Extract a data field from a ByteArray as a Date object containing only
time values.
|
void |
formatToString(ByteArray record,
org.apache.commons.lang3.builder.ToStringBuilder sb)
Format the field into a ToStringBuilder object.
|
void |
formatToXml(ByteArray record,
ToXmlBuilder xb)
Format the field into a ToStringBuilder object.
|
void |
insert(byte[] value,
ByteArray record) |
void |
insert(ByteArray value,
ByteArray record) |
void |
insert(byte value,
ByteArray record) |
void |
insert(int value,
ByteArray record) |
void |
insert(long value,
ByteArray record) |
void |
insert(OnUsField value,
ByteArray record) |
void |
insert(RoutingNumber value,
ByteArray record) |
void |
insert(short value,
ByteArray record) |
void |
insert(String value,
ByteArray record) |
void |
insertAsString(int value,
ByteArray record) |
void |
insertAsString(long value,
ByteArray record) |
void |
insertDate(Date value,
ByteArray record) |
void |
insertDate(Date value,
ByteArray record,
TimeZone zone) |
void |
insertPns(String value,
ByteArray record) |
void |
insertRight(String value,
ByteArray record) |
void |
insertTime(Date value,
ByteArray record) |
void |
insertTime(Date value,
ByteArray record,
TimeZone zone) |
boolean |
isType(FieldType type) |
String |
name() |
void |
setBit(byte mask,
ByteArray record) |
boolean |
testBit(byte mask,
ByteArray record) |
String |
toString() |
FieldType |
type() |
protected static SimpleDateFormat sdfDate
protected static SimpleDateFormat sdfTime
public Field()
public Field(int offset,
int length)
public Field(int offset,
int length,
FieldType type)
public Field(String fieldName, int fieldNumber, int offset, int length)
public boolean isType(FieldType type)
public FieldType type()
public Object extract(ByteArray record) throws InvalidDataException
record - A ByteArray containing an ASN.1 format recordInvalidDataExceptionpublic byte[] extractAsBytes(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic ByteArray extractAsByteArray(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic String extractAsString(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic long extractStringAsLong(ByteArray record) throws InvalidDataException
record - A ByteArray containing an ASN.1 format recordInvalidDataExceptionpublic int extractStringAsInt(ByteArray record) throws InvalidDataException
record - A ByteArray containing a ASN.1 format recordInvalidDataExceptionpublic long extractAsLong(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic byte extractAsByte(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic short extractAsShort(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic int extractAsInt(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic String extractPnsAsString(ByteArray record)
record - A ByteArray containing an ASN.1 format recordpublic Date extractStringAsDate(ByteArray record) throws InvalidDataException
record - A ByteArray containing an ASN.1 format recordInvalidDataExceptionpublic Date extractStringAsDate(ByteArray record, TimeZone zone) throws InvalidDataException
record - A ByteArray containing an ASN.1 format recordInvalidDataExceptionpublic Date extractStringAsTime(ByteArray record) throws InvalidDataException
record - A ByteArray containing an ASN.1 format recordInvalidDataExceptionpublic Date extractStringAsTime(ByteArray record, TimeZone zone) throws InvalidDataException
record - A ByteArray containing an ASN.1 format recordzone - A TimeZone object identifying the time zone for the time being
extractedInvalidDataExceptionpublic RoutingNumber extractStringAsRoutingNumber(ByteArray record)
record - A ByteArray containing a ASN.1 format recordInvalidDataExceptionpublic OnUsField extractStringAsOnUsField(ByteArray record)
record - A ByteArray containing a ASN.1 format recordInvalidDataExceptionpublic void insert(byte[] value,
ByteArray record)
value - A field value contained in an array of bytes.record - A ByteArray containing an ASN.1 format recordpublic void insert(ByteArray value, ByteArray record)
value - A field value contained in a ByteArray to be stored into the
ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(String value, ByteArray record)
value - A field value contained in a String to be stored into the
ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insertRight(String value, ByteArray record)
value - A field value contained in a String to be stored into the
ByteArray right justified and space filled.record - A ByteArray containing an ASN.1 format recordpublic void insertAsString(long value,
ByteArray record)
value - A field value contained in a long to be converted to a String
and then to be stored into the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insertAsString(int value,
ByteArray record)
value - A field value contained in an int to be converted to a String
and then to be stored into the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(byte value,
ByteArray record)
value - A field value contained in an int and stored in big endion
binary format in the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(short value,
ByteArray record)
value - A field value contained in an int and stored in big endion
binary format in the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(int value,
ByteArray record)
value - A field value contained in an int and stored in big endion
binary format in the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(long value,
ByteArray record)
value - A field value contained in an long and stored in big endion
binary format in the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insertDate(Date value, ByteArray record)
value - A field value contained in a Date object to be converted to a
String and then to be stored into the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insertDate(Date value, ByteArray record, TimeZone zone)
value - A field value contained in a Date object to be converted to a
String and then to be stored into the ByteArray.zone - A TimeZone object identifying the time zone for the date being
extracted. Based on the time value in the date object, this
could result in the date value being a different date than the
local date.record - A ByteArray containing an ASN.1 format recordpublic void insertTime(Date value, ByteArray record)
value - A field value contained in a Date object as a time value to be
converted to a String and then to be stored into the
ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insertTime(Date value, ByteArray record, TimeZone zone)
value - A field value contained in a Date object as a time value to be
converted to a String and then to be stored into the
ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(RoutingNumber value, ByteArray record)
value - A field value contained in a RoutingNumber to be stored into
the ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insert(OnUsField value, ByteArray record)
value - A field value contained in a OnUsField to be stored into the
ByteArray.record - A ByteArray containing an ASN.1 format recordpublic void insertPns(String value, ByteArray record)
value - A field value to be stored as a PNS value in the ByteArrayrecord - A ByteArray containing an ASN.1 format recordpublic void setBit(byte mask,
ByteArray record)
mask - A mask value to indicate which bits are to be set.record - A ByteArray containing an ASN.1 format recordpublic void clearBit(byte mask,
ByteArray record)
mask - A mask value to indicate which bits are to be cleared.record - A ByteArray containing an ASN.1 format recordpublic boolean testBit(byte mask,
ByteArray record)
mask - A mask value to indicate which bits are to be tested.record - A ByteArray containing an ASN.1 format recordpublic String name()
public void formatToString(ByteArray record, org.apache.commons.lang3.builder.ToStringBuilder sb)
record - sb - public void formatToXml(ByteArray record, ToXmlBuilder xb)
record - xb - Copyright © 2009–2016 The Last Check, LLC. All rights reserved.