Package org.ldaptive.io
Class JsonWriter
java.lang.Object
org.ldaptive.io.JsonWriter
- All Implemented Interfaces:
SearchResultWriter
Writes a
SearchResponse as JSON to a Writer.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classSerializes aSearchResponseby creating a json array to contain the entries. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.gson.GsonTo convert a search result to JSON.private final WriterWriter to write to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(SearchResponse result) Writes the supplied search result to the writer.
-
Field Details
-
jsonWriter
Writer to write to. -
gson
private final com.google.gson.Gson gsonTo convert a search result to JSON.
-
-
Constructor Details
-
JsonWriter
Creates a new json writer.- Parameters:
writer- to write JSON to
-
-
Method Details
-
write
Writes the supplied search result to the writer.- Specified by:
writein interfaceSearchResultWriter- Parameters:
result- search result to write- Throws:
IOException- if an error occurs using the writer
-