• 大小: 29KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-01
  • 语言: Java
  • 标签: java  iso8583  银联  

资源简介

iso8583协议的java实现,适用于金融业中套用此协议的开发。如银联缴费接口等

资源截图

代码片段和文件信息

/*
j8583 A Java implementation of the ISO8583 protocol
Copyright (C) 2007 Enrique Zamudio Lopez

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.

This library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not write to the Free Software
Foundation Inc. 51 Franklin Street Fifth Floor Boston MA  02110-1301 USA
*/
package com.solab.iso8583;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Iterator;

/** Represents an ISO8583 message. This is the core class of the framework.
 * Contains the bitmap which is modified as fields are added/removed.
 * This class makes no assumptions as to what types belong in each field
 * nor what fields should each different message type have; that is left
 * for the developer since the different ISO8583 implementations can vary
 * greatly.
 * 
 * @author Enrique Zamudio
 */
public class IsoMessage {

static final byte[] HEX = new byte[]{ ‘0‘ ‘1‘ ‘2‘ ‘3‘ ‘4‘ ‘5‘ ‘6‘ ‘7‘ ‘8‘ ‘9‘ ‘A‘ ‘B‘ ‘C‘ ‘D‘ ‘E‘ ‘F‘ };

/** The message type. */
    private int type;
    /** Indicates if the message is binary-coded. */
    private boolean binary;
    /** This is where the values are stored. */
    private Hashtable fields = new Hashtable();
    /** Stores the optional ISO header. */
    private String isoHeader;
    private int etx = -1;

    /** Creates a new empty message with no values set. */
    public IsoMessage() {
    }

    /** Creates a new message with the specified ISO header. This will be prepended to the message. */
    IsoMessage(String header) {
     isoHeader = header;
    }

    /** Returns the ISO header that this message was created with. */
    public String getIsoHeader() {
     return isoHeader;
    }

    /** Sets the ISO message type. Common values are 0x200 0x210 0x400 0x410 0x800 0x810. */
    public void setType(int value) {
     type = value;
    }
    /** Returns the ISO message type. */
    public int getType() {
     return type;
    }

    /** Indicates whether the message should be binary. Default is false. */
    public void setBinary(boolean flag) {
     binary = flag;
    }
    /** Returns true if the message is binary coded; default is false. */
    public boolean isBinary() {
     return binary;
    }

    /** Sets the ETX character which is sent at the end of the message as a terminator.
   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2008-01-21 19:31  src\
     目录           0  2008-01-21 19:31  src\com\
     目录           0  2008-01-21 19:31  src\com\solab\
     目录           0  2008-01-21 19:31  src\com\solab\iso8583\
     目录           0  2008-01-21 19:31  src\com\solab\iso8583\impl\
     目录           0  2008-01-21 19:31  src\com\solab\iso8583\parse\
     目录           0  2008-01-21 19:31  src\j8583\
     目录           0  2008-01-21 19:31  src\j8583\example\
     文件       10361  2008-01-21 19:59  src\com\solab\iso8583\IsoMessage.java
     文件        6719  2008-01-21 20:04  src\com\solab\iso8583\IsoType.java
     文件        7002  2008-01-21 19:36  src\com\solab\iso8583\IsoValue.java
     文件       11545  2008-01-21 20:00  src\com\solab\iso8583\MessageFactory.java
     文件        1356  2008-01-21 19:31  src\com\solab\iso8583\TraceNumberGenerator.java
     文件        1952  2008-01-21 19:31  src\com\solab\iso8583\impl\SimpleTraceGenerator.java
     文件         305  2008-01-21 19:31  src\com\solab\iso8583\package.html
     文件        6780  2008-01-21 20:06  src\com\solab\iso8583\parse\ConfigParser.java
     文件        8756  2008-01-21 19:52  src\com\solab\iso8583\parse\FieldParseInfo.java
     文件         505  2008-01-21 19:31  src\com\solab\iso8583\parse\j8583.dtd
     文件         211  2008-01-21 19:31  src\com\solab\iso8583\parse\package.html
     文件        5050  2008-01-21 20:08  src\j8583\example\Client.java
     文件        3351  2008-01-21 20:10  src\j8583\example\Example.java
     文件        4260  2008-01-21 20:14  src\j8583\example\Server.java
     文件        3443  2008-01-21 19:31  src\j8583\example\config.xml
     文件         602  2008-01-21 19:31  src\j8583\example\package.html
     文件         578  2008-01-21 19:31  src\j8583\example\parse.txt
     文件         203  2008-01-21 19:31  src\log4j.properties
     文件        2904  2008-01-21 20:19  build.xml
     目录           0  2008-01-21 20:17  example\
     文件         158  2008-01-21 20:17  example\run-channel-server.sh
     文件         151  2007-06-07 18:44  example\run-client.sh
     文件         151  2007-06-07 18:44  example\run-server.sh
............此处省略0个文件信息

评论

共有 条评论