|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.lang.acl.StringACLCodec
public class StringACLCodec
This class implements the FIPA String codec for ACLMessages. Notice that it is not possible to convey a sequence of bytes over a StringACLCodec because the bytes with the 8th bit ON cannot properly converted into a char.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface jade.lang.acl.ACLCodec |
|---|
ACLCodec.CodecException |
| Field Summary | |
|---|---|
static java.lang.String |
NAME
String constant for the name of the ACL representation managed by this ACL codec. |
| Fields inherited from interface jade.lang.acl.ACLCodec |
|---|
DEFAULT_CHARSET |
| Constructor Summary | |
|---|---|
StringACLCodec()
constructor for the codec. |
|
StringACLCodec(java.io.Reader r,
java.io.Writer w)
constructor for the codec. |
|
| Method Summary | |
|---|---|
static void |
appendACLExpression(java.lang.StringBuffer str,
java.lang.String slotName,
java.lang.String slotValue)
append to the passed StringBuffer the slot name and value separated by a blank char and followed by a newline. |
ACLMessage |
decode()
decode and parses the next message from the Reader passed in the constructor. |
ACLMessage |
decode(byte[] data,
java.lang.String charset)
Recovers an ACLMessage object back from raw data,
using the specific message representation to interpret the byte
sequence. |
AID |
decodeAID()
Parse an agent identifier, without it being included within an ACL message. |
byte[] |
encode(ACLMessage msg,
java.lang.String charset)
If the content of the message is a byteSequence, then this method encodes the content in Base64 and automatically sets the value of the encoding slot. |
java.lang.String |
getName()
Query the name of the message representation handled by this Codec object. |
void |
write(ACLMessage msg)
encodes the message and writes it into the Writer passed in the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String NAME
| Constructor Detail |
|---|
public StringACLCodec()
public StringACLCodec(java.io.Reader r,
java.io.Writer w)
| Method Detail |
|---|
public ACLMessage decode()
throws ACLCodec.CodecException
ACLCodec.CodecException - if any Exception occurs during the
parsing/reading operation
public AID decodeAID()
throws ACLCodec.CodecException
ACLCodec.CodecExceptionpublic void write(ACLMessage msg)
flush on the writer.
public byte[] encode(ACLMessage msg,
java.lang.String charset)
encode in interface ACLCodecmsg - The ACL message to encode.charset - Charset encoding to use (e.g. US_ASCII, UTF-8, etc)
ACLCodec#encode(ACLMessage msg)
public ACLMessage decode(byte[] data,
java.lang.String charset)
throws ACLCodec.CodecException
ACLCodecACLMessage object back from raw data,
using the specific message representation to interpret the byte
sequence.
decode in interface ACLCodecdata - The byte sequence containing the encoded message.charset - Charset encoding to use (e.g. US_ASCII, UTF-8, etc)
ACLMessage object, built from the raw
data.
ACLCodec.CodecException - If some kind of syntax error occurs.ACLCodec#decode(byte[] data)public java.lang.String getName()
ACLCodecCodec object. The FIPA standard representations have
a name starting with "fipa.acl.rep.".
getName in interface ACLCodec
public static void appendACLExpression(java.lang.StringBuffer str,
java.lang.String slotName,
java.lang.String slotValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||