Class DefaultJsonSerializer

java.lang.Object
io.vertigo.vega.plugins.webservice.handler.converter.DefaultJsonSerializer
All Implemented Interfaces:
JsonSerializer

public final class DefaultJsonSerializer extends Object implements JsonSerializer
Default JsonConverter.
Author:
npiedeloup
  • Constructor Details

    • DefaultJsonSerializer

      @Inject public DefaultJsonSerializer(JsonEngine jsonWriterEngine)
      Parameters:
      jsonWriterEngine - jsonWriterEngine
  • Method Details

    • canHandle

      public boolean canHandle(Class<?> paramClass)
      Specified by:
      canHandle in interface JsonSerializer
      Parameters:
      paramClass - Class to test
      Returns:
      If this converter can output this type of data.
    • toJson

      public String toJson(Object result, jakarta.servlet.http.HttpServletResponse response, WebServiceDefinition webServiceDefinition)
      Convert result to json.
      Specified by:
      toJson in interface JsonSerializer
      Parameters:
      result - Result
      response - Response
      webServiceDefinition - WebService definition
      Returns:
      Json (or empty string)