|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jetrix.protocols.AbstractProtocol
net.jetrix.protocols.ConsoleProtocol
public class ConsoleProtocol
Protocol to communicate with a console client
| Constructor Summary | |
|---|---|
ConsoleProtocol()
|
|
| 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 line)
Parse the specified string and return the corresponding server message for this protocol. |
String |
getName()
Return the name of this protocol |
Map<String,String> |
getStyles()
|
String |
translate(Message m,
Locale locale)
Translate the specified message into a string that will be sent to a client using this protocol. |
String |
translate(TextMessage m,
Locale locale)
|
| Methods inherited from class net.jetrix.protocols.AbstractProtocol |
|---|
equals, hashCode, readFrame, readLine, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConsoleProtocol()
| Method Detail |
|---|
public String getName()
public Message getMessage(String line)
line - the client message to parse
Message equivalent of the specified
String or null if the protocol cannot understand the message.
public 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.
public String translate(TextMessage m,
Locale locale)
public Map<String,String> getStyles()
public String applyStyle(String text)
Protocol
text - the string to transform
public char getEOL()
Protocol
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||