public abstract class StructuredField extends java.lang.Object implements IAFPDecodeableWriteable
StructuredFields.| Constructor and Description |
|---|
StructuredField() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkDataLength(byte[] sfData,
int offset,
int length,
int minLength) |
abstract void |
decodeAFP(byte[] sfData,
int offset,
int length,
AFPParserConfiguration config)
Decodes the given AFP data.
Parameter length specifies the length in bytes of the data to be decoded, beginning with position offset. |
static int |
getActualLength(byte[] sfData,
int offset,
int length)
Returns the actual length of data to process contained in sfData.
|
byte[] |
getPadding()
Returns the padding bytes of this structured field, or null if this structured field has no
padding bytes.
|
StructuredFieldIntroducer |
getStructuredFieldIntroducer()
Returns the
StructuredFieldIntroducer of this structured field. |
boolean |
isBeginSF()
Returns true, if this structured field indicates the begin a complex structured field that may
contain other structured fields.
|
boolean |
isEndSF()
Returns true, if this structured field indicates the end of a complex structured field that may
contain other structured fields.
|
boolean |
isShallow() |
void |
setPadding(byte[] padding)
Sets the padding bytes of this structured field and set the padding flag.
If the given padding is null the padding flag is revoked. |
void |
setStructuredFieldIntroducer(StructuredFieldIntroducer structuredFieldIntroducer)
Sets the
StructuredFieldIntroducer of this structured field. |
java.lang.String |
toString() |
abstract void |
writeAFP(java.io.OutputStream os,
AFPParserConfiguration config)
Writes the object to the given os encoded as AFP data.
|
protected void |
writeFullStructuredField(java.io.OutputStream os,
byte[] netPayloadWithoutSFIandPadding)
Writes out the SFI, the given net payload, and padding data.
|
public static void checkDataLength(byte[] sfData,
int offset,
int length,
int minLength)
throws AFPParserException
AFPParserExceptionpublic static int getActualLength(byte[] sfData,
int offset,
int length)
public abstract void decodeAFP(byte[] sfData,
int offset,
int length,
AFPParserConfiguration config)
throws AFPParserException
IAFPDecodeableWriteabledecodeAFP in interface IAFPDecodeableWriteablesfData - contains the AFP data to decode.offset - the byte index position where the decoding should start.length - the length in bytes of the data to be decoded, beginning with position offset.config - contains parameter used for decoding.AFPParserException - if the given AFP data are invalid.public abstract void writeAFP(java.io.OutputStream os,
AFPParserConfiguration config)
throws java.io.IOException
IAFPDecodeableWriteablewriteAFP in interface IAFPDecodeableWriteableos - OutputStream to write to.config - contains parameter used for encoding.java.io.IOException - if a problem occurs while writing to the given OutputStream.public StructuredFieldIntroducer getStructuredFieldIntroducer()
StructuredFieldIntroducer of this structured field.StructuredFieldIntroducer of this structured field.public void setStructuredFieldIntroducer(StructuredFieldIntroducer structuredFieldIntroducer)
StructuredFieldIntroducer of this structured field.structuredFieldIntroducer - the StructuredFieldIntroducer of this structured
field.public byte[] getPadding()
public void setPadding(byte[] padding)
padding - the padding bytes of this structured field, may be null.protected void writeFullStructuredField(java.io.OutputStream os,
byte[] netPayloadWithoutSFIandPadding)
throws java.io.IOException
Sets the length byte[0,1] of resulting SF Data and updates the StructuredFieldIntroducer.sfLength.
os - OutputStream to write to.netPayloadWithoutSFIandPadding - the net payload without SFI and padding data. May be null
or empty array.java.io.IOException - if writing to the given OutputStream fails.public boolean isBeginSF()
BPG_BeginPage, BBC_BeginBarCodeObject,public boolean isEndSF()
EPG_EndPage, EBC_EndBarCodeObject,public boolean isShallow()
public java.lang.String toString()
toString in class java.lang.Object