Class ISODatasetField
java.lang.Object
org.jpos.iso.ISOComponent
org.jpos.iso.ISODatasetField
- All Implemented Interfaces:
Cloneable
Composite ISO field that holds one or more datasets.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an unbound dataset field.ISODatasetField(int fieldNumber) Creates a dataset field bound to an outer field number. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataset(Dataset dataset) Appends a dataset to this field.voiddump(PrintStream p, String indent) Dumps the field as dataset-aware XML.get(int datasetId, int elementId) Returns the component stored under the given dataset and element identifiers.byte[]getBytes()Dataset fields do not expose their bytes directly and must be packed via aDatasetFieldPackager.byte[]getBytes(int datasetId, int elementId) Returns the bytes stored under the given dataset and element identifiers.Returns this composite field.getDataset(int identifier) Returns the first dataset that matches the supplied identifier.Returns all datasets in insertion order.getDatasets(int identifier) Returns all datasets that match the supplied identifier.intReturns the outer ISO field number.getKey()Returns the outer ISO field number.getValue()Returns the datasets carried by this field.getValue(int datasetId, int elementId) Returns the logical value stored under the given dataset and element identifiers.booleanIndicates whether this field still contains datasets.byte[]pack()Dataset fields must be packed through their field packager.voidremoveDataset(Dataset dataset) Removes a dataset instance from this field.voidsetFieldNumber(int fieldNumber) Sets the outer ISO field number.voidReplaces the datasets held by this field.intunpack(byte[] b) Dataset fields must be unpacked through their field packager.voidunpack(InputStream in) Dataset fields must be unpacked through their field packager.Methods inherited from class ISOComponent
getChildren, getMaxField, pack, set, unsetModifier and TypeMethodDescriptiondummy behaviour - return empty mapinta Composite must override this functionvoidpack(OutputStream out) Packs this component and writes it toout.voidset(ISOComponent c) Set a field within this messagevoidunset(int fldno) Unset a field
-
Constructor Details
-
ISODatasetField
public ISODatasetField()Creates an unbound dataset field. -
ISODatasetField
Creates a dataset field bound to an outer field number.- Parameters:
fieldNumber- outer field number
-
-
Method Details
-
addDataset
Appends a dataset to this field.- Parameters:
dataset- dataset to add
-
removeDataset
Removes a dataset instance from this field.- Parameters:
dataset- dataset to remove
-
hasDatasets
Indicates whether this field still contains datasets.- Returns:
truewhen at least one dataset is present
-
getDatasets
Returns all datasets in insertion order.- Returns:
- immutable list of datasets
-
getDatasets
Returns all datasets that match the supplied identifier.- Parameters:
identifier- dataset identifier- Returns:
- immutable list of matching datasets
-
getDataset
Returns the first dataset that matches the supplied identifier.- Parameters:
identifier- dataset identifier- Returns:
- matching dataset or
null
-
get
Returns the component stored under the given dataset and element identifiers.- Parameters:
datasetId- dataset identifierelementId- element identifier- Returns:
- matching component or
null
-
getValue
Returns the logical value stored under the given dataset and element identifiers.- Parameters:
datasetId- dataset identifierelementId- element identifier- Returns:
- element value or
null - Throws:
ISOException- on component access errors
-
getBytes
Returns the bytes stored under the given dataset and element identifiers.- Parameters:
datasetId- dataset identifierelementId- element identifier- Returns:
- element bytes or
null - Throws:
ISOException- on component access errors
-
getComposite
Returns this composite field.- Overrides:
getCompositein classISOComponent- Returns:
- this field
-
getKey
Returns the outer ISO field number.- Overrides:
getKeyin classISOComponent- Returns:
- outer field number
-
getValue
Returns the datasets carried by this field.- Overrides:
getValuein classISOComponent- Returns:
- dataset list
-
getBytes
Dataset fields do not expose their bytes directly and must be packed via aDatasetFieldPackager.- Overrides:
getBytesin classISOComponent- Returns:
- never returns normally
- Throws:
ISOException- always
-
setFieldNumber
Sets the outer ISO field number.- Specified by:
setFieldNumberin classISOComponent- Parameters:
fieldNumber- outer field number
-
getFieldNumber
Returns the outer ISO field number.- Specified by:
getFieldNumberin classISOComponent- Returns:
- outer field number
-
setValue
Replaces the datasets held by this field.- Specified by:
setValuein classISOComponent- Parameters:
obj- either aDatasetor aListof datasets- Throws:
ISOException- when the supplied value type is unsupported
-
pack
Dataset fields must be packed through their field packager.- Specified by:
packin classISOComponent- Returns:
- never returns normally
- Throws:
ISOException- always
-
unpack
Dataset fields must be unpacked through their field packager.- Specified by:
unpackin classISOComponent- Parameters:
b- source buffer- Returns:
- never returns normally
- Throws:
ISOException- always
-
unpack
Dataset fields must be unpacked through their field packager.- Specified by:
unpackin classISOComponent- Parameters:
in- source stream- Throws:
ISOException- always
-
dump
Dumps the field as dataset-aware XML.- Specified by:
dumpin classISOComponent- Parameters:
p- destination streamindent- indentation prefix
-