com.github.nmorel.gwtjackson.client.ser.StringJsonSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gwt-jackson Show documentation
Show all versions of gwt-jackson Show documentation
gwt-jackson is a GWT JSON serializer/deserializer mechanism based on Jackson annotations
package com.github.nmorel.gwtjackson.client.ser;
import javax.annotation.Nonnull;
import java.io.IOException;
import com.github.nmorel.gwtjackson.client.JsonSerializationContext;
import com.github.nmorel.gwtjackson.client.JsonSerializer;
import com.github.nmorel.gwtjackson.client.stream.JsonWriter;
/**
* Default {@link JsonSerializer} implementation for {@link String}.
*
* @author Nicolas Morel
*/
public class StringJsonSerializer extends JsonSerializer {
private static final StringJsonSerializer INSTANCE = new StringJsonSerializer();
/**
* @return an instance of {@link StringJsonSerializer}
*/
public static StringJsonSerializer getInstance() {
return INSTANCE;
}
private StringJsonSerializer() { }
@Override
public void doSerialize( JsonWriter writer, @Nonnull String value, JsonSerializationContext ctx ) throws IOException {
writer.value( value );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy