Package org.cometd.common
Class JacksonJSONContext<T extends Message.Mutable,I extends T>
- java.lang.Object
-
- org.cometd.common.JacksonJSONContext<T,I>
-
- Direct Known Subclasses:
JacksonJSONContextClient
,JacksonJSONContextServer
public abstract class JacksonJSONContext<T extends Message.Mutable,I extends T> extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JacksonJSONContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
generate(List<T> messages)
String
generate(T message)
JSONContext.Generator
getGenerator()
com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
JSONContext.Parser
getParser()
T[]
parse(InputStream stream)
T[]
parse(Reader reader)
T[]
parse(String json)
protected abstract Class<I[]>
rootArrayClass()
-
-
-
Method Detail
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
parse
public T[] parse(InputStream stream) throws ParseException
- Throws:
ParseException
-
parse
public T[] parse(Reader reader) throws ParseException
- Throws:
ParseException
-
parse
public T[] parse(String json) throws ParseException
- Throws:
ParseException
-
getParser
public JSONContext.Parser getParser()
-
getGenerator
public JSONContext.Generator getGenerator()
-
-