Search in sources :

Example 66 with ISOException

use of org.jpos.iso.ISOException in project jPOS by jpos.

the class CTCSubFieldPackager method pack.

public byte[] pack(ISOComponent c) throws ISOException {
    try {
        Map tab = c.getChildren();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < fld.length; i++) {
            ISOField f = (ISOField) tab.get(i);
            if (f != null) {
                sb.append(new String(fld[i].pack(f)));
            }
        }
        return sb.toString().getBytes();
    } catch (Exception ex) {
        throw new ISOException(this.getRealm() + ": " + ex.getMessage(), ex);
    }
}
Also used : ISOField(org.jpos.iso.ISOField) ISOException(org.jpos.iso.ISOException) Map(java.util.Map) ISOVException(org.jpos.iso.validator.ISOVException) ISOException(org.jpos.iso.ISOException)

Aggregations

ISOException (org.jpos.iso.ISOException)66 Test (org.junit.Test)36 ISOMsg (org.jpos.iso.ISOMsg)29 ISOField (org.jpos.iso.ISOField)15 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)12 ISOBaseValidator (org.jpos.iso.ISOBaseValidator)8 IOException (java.io.IOException)7 ISOBinaryField (org.jpos.iso.ISOBinaryField)7 TEST0100 (org.jpos.iso.validator.TEST0100)7 Map (java.util.Map)6 ConfigurationException (org.jpos.core.ConfigurationException)6 ISOComponent (org.jpos.iso.ISOComponent)6 ISOFieldValidator (org.jpos.iso.ISOFieldValidator)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 LogEvent (org.jpos.util.LogEvent)5 SAXParseException (org.xml.sax.SAXParseException)5 IVA_ALPHANUMNOBLANK (org.jpos.iso.IVA_ALPHANUMNOBLANK)4 ISOVException (org.jpos.iso.validator.ISOVException)4 ISOTaggedField (org.jpos.tlv.ISOTaggedField)4 ArrayList (java.util.ArrayList)3