Package jodd.json.impl

Examples of jodd.json.impl.DateJsonSerializer


    map.put(BigDecimal.class, jsonSerializer);

    // other

    map.put(Boolean.class, new BooleanJsonSerializer());
    map.put(Date.class, new DateJsonSerializer());
    map.put(Calendar.class, new CalendarJsonSerializer());
    map.put(JDateTime.class, new JDateTimeSerializer());
    map.put(Enum.class, new EnumJsonSerializer());

    jsonSerializer = new CharacterJsonSerializer();
View Full Code Here


    final SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
    Person foo = new Person("Foo", "Bar", new Date(), null, null);
    foo.setBirthdate(df.parse("2009/01/02"));


    String json = new JsonSerializer().use("birthdate", new DateJsonSerializer() {
      @Override
      public void serialize(JsonContext jsonContext, Date date) {
        jsonContext.writeString(df.format(date));
      }
    }).serialize(foo);
View Full Code Here

TOP

Related Classes of jodd.json.impl.DateJsonSerializer

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.