|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.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 |
toString()
|
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConsoleProtocol()
Method Detail |
---|
public String getName()
getName
in interface Protocol
public Message getMessage(String line)
getMessage
in interface Protocol
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)
translate
in interface Protocol
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
applyStyle
in interface Protocol
text
- the string to transform
public char getEOL()
Protocol
getEOL
in interface Protocol
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |