|
jPOS 1.6.5 API Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jpos.util.FSDMsg
public class FSDMsg
General purpose, Field Separator delimited message.
The message format (or schema) is defined in xml files containing a schema element, with an optional id attribute, and multiple field elements. A field element is made up of the following attributes:
set(String, String). It should be unique amongst the fields in an FSDMsg.Possible types are:
Supported field separators are:
Key fields allow you to specify a tree of possible message formats. The key fields are the fork points of the tree. Multiple key fields are supported. It is also possible to have more key fields specified in appended schemas.
| Field Summary | |
|---|---|
static char |
EOF
|
static char |
FS
|
static char |
GS
|
static char |
PIPE
|
static char |
RS
|
static char |
US
|
| Constructor Summary | |
|---|---|
FSDMsg(java.lang.String basePath)
Creates a FSDMsg with a specific base path for the message format schema. |
|
FSDMsg(java.lang.String basePath,
java.lang.String baseSchema)
Creates a FSDMsg with a specific base path for the message format schema, and a base schema name. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
void |
copy(java.lang.String fieldName,
FSDMsg msg)
|
void |
dump(java.io.PrintStream p,
java.lang.String indent)
|
java.lang.String |
get(java.lang.String fieldName)
|
java.lang.String |
get(java.lang.String fieldName,
java.lang.String def)
|
java.lang.String |
getBasePath()
|
java.lang.String |
getBaseSchema()
|
byte[] |
getHeader()
|
byte[] |
getHexBytes(java.lang.String name)
|
java.lang.String |
getHexHeader()
|
int |
getInt(java.lang.String name)
|
int |
getInt(java.lang.String name,
int def)
|
java.util.Map |
getMap()
|
boolean |
hasField(java.lang.String fieldName)
|
boolean |
isSeparator(byte b)
|
java.lang.String |
pack()
|
byte[] |
packToBytes()
|
void |
set(java.lang.String name,
java.lang.String value)
|
void |
setHeader(byte[] h)
|
void |
setMap(java.util.Map fields)
|
void |
setSeparator(java.lang.String separatorName,
char separator)
|
org.jdom.Element |
toXML()
|
void |
unpack(byte[] b)
parse message. |
void |
unpack(java.io.InputStream is)
parse message. |
void |
unsetSeparator(java.lang.String separatorName)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static char FS
public static char US
public static char GS
public static char RS
public static char EOF
public static char PIPE
| Constructor Detail |
|---|
public FSDMsg(java.lang.String basePath)
basePath - schema path, for example: "file:src/data/NDC-" looks for a file src/data/NDC-base.xml
public FSDMsg(java.lang.String basePath,
java.lang.String baseSchema)
basePath - schema pathbaseSchema - schema name| Method Detail |
|---|
public java.lang.String getBasePath()
public java.lang.String getBaseSchema()
public void setSeparator(java.lang.String separatorName,
char separator)
public void unsetSeparator(java.lang.String separatorName)
public void unpack(java.io.InputStream is)
throws java.io.IOException,
org.jdom.JDOMException,
java.net.MalformedURLException
is - input stream
java.io.IOException
org.jdom.JDOMException
java.net.MalformedURLException
public void unpack(byte[] b)
throws java.io.IOException,
org.jdom.JDOMException,
java.net.MalformedURLException
b - message image
java.io.IOException
org.jdom.JDOMException
java.net.MalformedURLException
ISOException
public java.lang.String pack()
throws org.jdom.JDOMException,
java.net.MalformedURLException,
java.io.IOException,
ISOException
ISOException
org.jdom.JDOMException
java.net.MalformedURLException
java.io.IOException
public byte[] packToBytes()
throws org.jdom.JDOMException,
java.net.MalformedURLException,
java.io.IOException,
ISOException,
java.io.UnsupportedEncodingException
org.jdom.JDOMException
java.net.MalformedURLException
java.io.IOException
ISOException
java.io.UnsupportedEncodingExceptionpublic boolean isSeparator(byte b)
public void set(java.lang.String name,
java.lang.String value)
public void setHeader(byte[] h)
public byte[] getHeader()
public java.lang.String getHexHeader()
public java.lang.String get(java.lang.String fieldName)
public java.lang.String get(java.lang.String fieldName,
java.lang.String def)
public void copy(java.lang.String fieldName,
FSDMsg msg)
public byte[] getHexBytes(java.lang.String name)
public int getInt(java.lang.String name)
public int getInt(java.lang.String name,
int def)
public org.jdom.Element toXML()
public java.util.Map getMap()
public void setMap(java.util.Map fields)
public void dump(java.io.PrintStream p,
java.lang.String indent)
dump in interface Loggeablepublic boolean hasField(java.lang.String fieldName)
public java.lang.Object clone()
clone in class java.lang.Object
|
jPOS.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||