Class JettyJSONContextServer
- All Implemented Interfaces:
JSONContext<ServerMessage.Mutable>,JSONContextServer
public class JettyJSONContextServer
extends JettyJSONContext<ServerMessage.Mutable>
implements JSONContextServer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cometd.common.JettyJSONContext
JettyJSONContext.AsyncJSONFactory, JettyJSONContext.AsyncJSONParser, JettyJSONContext.JSONGeneratorNested classes/interfaces inherited from interface org.cometd.common.JSONContext
JSONContext.AsyncParser, JSONContext.Client, JSONContext.Generator, JSONContext.Parser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate(ServerMessage.Mutable message) Converts a single message to a JSON string.protected ServerMessage.MutablenewRoot()protected ServerMessage.Mutable[]newRootArray(int size) Methods inherited from class org.cometd.common.JettyJSONContext
generate, getAsyncJSONFactory, getJSON, getParser, parse, parse, parse, putConvertor
-
Constructor Details
-
JettyJSONContextServer
public JettyJSONContextServer()
-
-
Method Details
-
newRoot
- Specified by:
newRootin classJettyJSONContext<ServerMessage.Mutable>
-
newRootArray
- Specified by:
newRootArrayin classJettyJSONContext<ServerMessage.Mutable>
-
newAsyncParser
- Specified by:
newAsyncParserin interfaceJSONContext<ServerMessage.Mutable>- Overrides:
newAsyncParserin classJettyJSONContext<ServerMessage.Mutable>- Returns:
- a new
JSONContext.AsyncParserinstance, or null if non-blocking parsing is not supported
-
generate
Description copied from interface:JSONContextConverts a single message to a JSON string.
- Specified by:
generatein interfaceJSONContext<ServerMessage.Mutable>- Specified by:
generatein interfaceJSONContextServer- Overrides:
generatein classJettyJSONContext<ServerMessage.Mutable>- Parameters:
message- the message to stringify- Returns:
- the JSON string for the message
-
getGenerator
- Specified by:
getGeneratorin interfaceJSONContext<ServerMessage.Mutable>- Overrides:
getGeneratorin classJettyJSONContext<ServerMessage.Mutable>- Returns:
- a JSON generator to stringify any object to a JSON string
-