Package org.cometd.server
Class JacksonJSONContextServer
java.lang.Object
org.cometd.common.JacksonJSONContext<ServerMessage.Mutable,ServerMessageImpl>
org.cometd.server.JacksonJSONContextServer
- All Implemented Interfaces:
JSONContext<ServerMessage.Mutable>
,JSONContextServer
public class JacksonJSONContextServer extends JacksonJSONContext<ServerMessage.Mutable,ServerMessageImpl> implements JSONContextServer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cometd.common.JacksonJSONContext
JacksonJSONContext.ObjectMapperGenerator
Nested classes/interfaces inherited from interface org.cometd.common.JSONContext
JSONContext.AsyncParser, JSONContext.Client, JSONContext.Generator, JSONContext.Parser
-
Constructor Summary
Constructors Constructor Description JacksonJSONContextServer()
-
Method Summary
Modifier and Type Method Description java.lang.String
generate(ServerMessage.Mutable message)
Converts a single message to a JSON string.JSONContext.Generator
getGenerator()
protected java.lang.Class<ServerMessageImpl[]>
rootArrayClass()
Methods inherited from class org.cometd.common.JacksonJSONContext
generate, getObjectMapper, getParser, newAsyncParser, parse, parse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cometd.common.JSONContext
generate, getParser, newAsyncParser, parse, parse
-
Constructor Details
-
JacksonJSONContextServer
public JacksonJSONContextServer()
-
-
Method Details
-
rootArrayClass
- Specified by:
rootArrayClass
in classJacksonJSONContext<ServerMessage.Mutable,ServerMessageImpl>
-
generate
Description copied from interface:JSONContext
Converts a single message to a JSON string.
- Specified by:
generate
in interfaceJSONContext<ServerMessage.Mutable>
- Specified by:
generate
in interfaceJSONContextServer
- Overrides:
generate
in classJacksonJSONContext<ServerMessage.Mutable,ServerMessageImpl>
- Parameters:
message
- the message to stringify- Returns:
- the JSON string for the message
-
getGenerator
- Specified by:
getGenerator
in interfaceJSONContext<ServerMessage.Mutable>
- Overrides:
getGenerator
in classJacksonJSONContext<ServerMessage.Mutable,ServerMessageImpl>
- Returns:
- a JSON generator to stringify any object to a JSON string
-