|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Protocol
A protocol to communicate with a client. A protocol is responsible for
transforming the messages in string format comming for a client into the
corresponding server Message, as well as performing the
reverse operation.
| Method Summary | |
|---|---|
String |
applyStyle(String text)
Transform the style tags (<blue>, <u>, etc...) contained in the specified string into the style codes of this protocol. |
char |
getEOL()
Return the end of line character used by this protocol. |
Message |
getMessage(String message)
Parse the specified string and return the corresponding server message for this protocol. |
String |
getName()
Return the name of this protocol. |
String |
readLine(InputStream in,
String encoding)
Read a line for this protocol. |
String |
translate(Message m,
Locale locale)
Translate the specified message into a string that will be sent to a client using this protocol. |
| Method Detail |
|---|
String getName()
Message getMessage(String message)
message - the client message to parse
Message equivalent of the specified
String or null if the protocol cannot understand the message.
String translate(Message m,
Locale locale)
m - the message to translatelocale - the locale used for internationalized text messages
Message or null if it can't be translated.String applyStyle(String text)
text - the string to transform
char getEOL()
String readLine(InputStream in,
String encoding)
throws IOException
getEOL()
method.
in - the stream to be readencoding - the charset encoding used to read the message
IOException - thrown if the stream is closed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||