Package org.codehaus.jackson

Examples of org.codehaus.jackson.Version


public class EndpointObjectMapper extends ObjectMapper {

  public EndpointObjectMapper() {
    SimpleModule simpleModule = new SimpleModule("SimpleModule",
              new Version(1,0,0,null));
   
    simpleModule.addSerializer(EndpointResponse.class, new EndpointResponseSerializer());
    registerModule(simpleModule);
    configure(Feature.INDENT_OUTPUT, true);
  }
View Full Code Here


public class EndpointResponseObjectMapper extends ObjectMapper {

  public EndpointResponseObjectMapper() {
    SimpleModule simpleModule = new SimpleModule("SimpleModule",
              new Version(1,0,0,null));
   
    simpleModule.addSerializer(EndpointResponse.class, new EndpointResponseSerializer());
    registerModule(simpleModule);
    configure(Feature.INDENT_OUTPUT, true);
  }
View Full Code Here

   *         Samza's job data model, and simple data types such as TaskName,
   *         Partition, Config, and SystemStreamPartition.
   */
  public static ObjectMapper getObjectMapper() {
    ObjectMapper mapper = new ObjectMapper();
    SimpleModule module = new SimpleModule("SamzaModule", new Version(1, 0, 0, ""));

    // Setup custom serdes for simple data types.
    module.addSerializer(Partition.class, new PartitionSerializer());
    module.addSerializer(SystemStreamPartition.class, new SystemStreamPartitionSerializer());
    module.addSerializer(TaskName.class, new TaskNameSerializer());
View Full Code Here

    }
  }

  public static String toJson(Object object) {
    ObjectMapper mapper = new ObjectMapper(new MyJsonFactory());
    SimpleModule module = new SimpleModule("fullcalendar", new Version(1, 0, 0, null));
    module.addSerializer(new DateTimeSerializer());
    module.addSerializer(new LocalTimeSerializer());
    mapper.registerModule(module);
    mapper.getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL);
View Full Code Here

  @Singleton
  public ObjectMapper getObjectMapper(Injector injector) {
    ObjectMapper mapper = new ObjectMapper();

    SimpleModule module =
            new SimpleModule("MySerializer", new Version(1, 0, 0, null));

    module.addSerializer(SimpleEvaluationObject.class, injector.getInstance(SimpleEvaluationObject.Serializer.class));
    module.addSerializer(EvaluationResult.class, injector.getInstance(EvaluationResult.Serializer.class));
    module.addSerializer(TableDisplay.class, injector.getInstance(TableDisplay.Serializer.class));
    module.addSerializer(OutputContainer.class, injector.getInstance(OutputContainer.Serializer.class));
View Full Code Here

  @Singleton
  public ObjectMapper getObjectMapper(Injector injector) {
    ObjectMapper mapper = new ObjectMapper();

    SimpleModule module =
            new SimpleModule("MySerializer", new Version(1, 0, 0, null));

    module.addSerializer(StringObject.class,
        injector.getInstance(StringObject.Serializer.class));
    module.addSerializer(SessionBackupRest.Plugin.class,
        injector.getInstance(SessionBackupRest.PluginSerializer.class));
View Full Code Here

    private static ObjectMapper createObjectMapper() {
        // it's a shame that the serialization and deserialization mechanism
        // used aren't symmetric... but it works.
        final DeserializerProvider deserializerProvider = new StdDeserializerProvider(new JsonRepresentationDeserializerFactory());
        final ObjectMapper objectMapper = new ObjectMapper(null, null, deserializerProvider);
        final SimpleModule jsonModule = new SimpleModule("json", new Version(1, 0, 0, null));
        jsonModule.addSerializer(JsonRepresentation.class, new JsonRepresentationSerializer());
        objectMapper.registerModule(jsonModule);

        objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
        objectMapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
View Full Code Here

* @author Bryce Fischer
* @author Robert Drysdale
*/
public class DropboxModule extends SimpleModule {
    public DropboxModule() {
        super("DropboxModule", new Version(1, 0, 0, null));
    }
View Full Code Here

     * returned.
     */
    public static Version versionFor(Class<?> cls)
    {
        InputStream in;
        Version version = null;
       
        try {
            in = cls.getResourceAsStream(VERSION_FILE);
            if (in != null) {
                try {
View Full Code Here

        }
        int major = parseVersionPart(parts[0]);
        int minor = parseVersionPart(parts[1]);
        int patch = (parts.length > 2) ? parseVersionPart(parts[2]) : 0;
        String snapshot = (parts.length > 3) ? parts[3] : null;
        return new Version(major, minor, patch, snapshot);
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.Version

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.