com.bankframe.ei.channel.codec
Class DPTPCodec

java.lang.Object
  extended by com.bankframe.ei.channel.codec.DPTPCodec
All Implemented Interfaces:
Codec
Direct Known Subclasses:
DPTPPaddingCodec

public class DPTPCodec
extends Object
implements Codec

This class converts DataPackets or Vectors of DataPackets to/from a compact XML representation. The aim of this class is to define a standard means of representing a DataPacket as a String. Secondly the class is designed to be lightweight and fast, therefore this class does all the xml encoding and decoding itself, it does not rely on third party XML packages such as Xerces or JAXP. This class is not as robust as fully fledged XML parsers, it can only handle the defined DataPacket xml reprensentation and it cannot handle xml strings that are not well formed.


Field Summary
static String CLOSE_TAG_BEGIN
           
static String CLOSE_TAG_END
           
static String DATAPACKET_END_TAG
           
static String DATAPACKET_ENTITY
           
static String DATAPACKET_START_TAG
           
static String GT_TOKEN
           
static String LT_TOKEN
           
static String NAME_TOKEN
           
static String OPEN_TAG_BEGIN
           
static String OPEN_TAG_END
           
static String OPEN_TAG_MIDDLE
           
static String ROOT_NODE_NAME
           
static String VALUE_END_TAG
           
static String VALUE_ENTITY
           
static String VALUE_START_TAG
           
static String VECTOR_END_TAG
           
static String VECTOR_ENTITY
           
static String VECTOR_START_TAG
           
static String XML_PI
           
 
Constructor Summary
DPTPCodec()
          DataPacketCodec constructor comment.
 
Method Summary
 Vector decode(String encoded)
          This method converts a xml DataPacket representation into a Vector of one or more DataPackets
 String encode(Vector dataPackets)
          This method encodes one or more DataPackets into a compact xml reprensentation
 String getName()
          Return the name of this codec.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_TOKEN

public static final String NAME_TOKEN
See Also:
Constant Field Values

OPEN_TAG_BEGIN

public static final String OPEN_TAG_BEGIN
See Also:
Constant Field Values

OPEN_TAG_MIDDLE

public static final String OPEN_TAG_MIDDLE
See Also:
Constant Field Values

OPEN_TAG_END

public static final String OPEN_TAG_END
See Also:
Constant Field Values

CLOSE_TAG_BEGIN

public static final String CLOSE_TAG_BEGIN
See Also:
Constant Field Values

CLOSE_TAG_END

public static final String CLOSE_TAG_END
See Also:
Constant Field Values

VECTOR_ENTITY

public static final String VECTOR_ENTITY
See Also:
Constant Field Values

DATAPACKET_ENTITY

public static final String DATAPACKET_ENTITY
See Also:
Constant Field Values

VALUE_ENTITY

public static final String VALUE_ENTITY
See Also:
Constant Field Values

VALUE_START_TAG

public static final String VALUE_START_TAG
See Also:
Constant Field Values

VALUE_END_TAG

public static final String VALUE_END_TAG
See Also:
Constant Field Values

VECTOR_START_TAG

public static final String VECTOR_START_TAG
See Also:
Constant Field Values

VECTOR_END_TAG

public static final String VECTOR_END_TAG
See Also:
Constant Field Values

DATAPACKET_START_TAG

public static final String DATAPACKET_START_TAG
See Also:
Constant Field Values

DATAPACKET_END_TAG

public static final String DATAPACKET_END_TAG
See Also:
Constant Field Values

ROOT_NODE_NAME

public static final String ROOT_NODE_NAME
See Also:
Constant Field Values

XML_PI

public static final String XML_PI
See Also:
Constant Field Values

LT_TOKEN

public static final String LT_TOKEN
See Also:
Constant Field Values

GT_TOKEN

public static final String GT_TOKEN
See Also:
Constant Field Values
Constructor Detail

DPTPCodec

public DPTPCodec()
DataPacketCodec constructor comment.

Method Detail

decode

public Vector decode(String encoded)
This method converts a xml DataPacket representation into a Vector of one or more DataPackets

Specified by:
decode in interface Codec
Parameters:
encoded - String containing the xml reprensentation
Returns:
Vector of one or more DataPackets

encode

public String encode(Vector dataPackets)
This method encodes one or more DataPackets into a compact xml reprensentation

Specified by:
encode in interface Codec
Parameters:
dataPackets - Vector of DataPackets
Returns:
String containing xml representation

getName

public String getName()
Return the name of this codec.

Specified by:
getName in interface Codec
Returns:
java.lang.String


Copyright © 2005, 2007, Oracle. All rights reserved.