import scala.reflect.BeanProperty case class DenormalizedRating (@BeanProperty var actLevStart: Int, @BeanProperty var actLevEnd: Int) { def this () = this (0, 0) // Default constructor for flexjson. def activityRating = actLevEnd - actLevStart } def cl = new flexjson.ClassLocator { val classLoader = Thread.currentThread.getContextClassLoader override def locate (map: java.util.Map[_,_], path: flexjson.Path): Class[_] = { if (map.containsKey ("actLevStart")) classOf[DenormalizedRating] else { val clazz = map.get ("class") // Flexjson class signature. if (clazz.isInstanceOf[String]) classLoader.loadClass (clazz.toString) else classOf[java.util.HashMap[_, _]] } } } (new flexjson.JSONDeserializer () .use (null, cl) .deserialize (""" {"foo1": "bar1", "foo2": {"actLevStart": 1, "actLevEnd": 2}, "foo3": {"someMapKey": "someMapValue"}} """)).toString pastebin - Herramienta Colaborativa

pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin - Herramienta Colaborativa - Home - View Help - Archive
Syntax Highlighting:
To highlight particular lines, prefix each line with @@
Pressing TAB inserts 3 spaces