XWiki Commons
  1. XWiki Commons
  2. XCOMMONS-131

Add a Velocity tool to serialize Java objects to JSON format

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-milestone-1
    • Fix Version/s: 4.0-milestone-2
    • Component/s: Velocity
    • Labels:
      None
    • Similar issues:
      XCOMMONS-408Add support for Velocity Tool parameters
      XCOMMONS-119Add velocity Collections tool to be able to create various types of collections
      XCOMMONS-520Impossible to convert to JSON a Map with a key named "null" using JSONTool
      XCOMMONS-429Add support for parsing JSON strings into JSON objects to the $jsontool
      XCOMMONS-426Provide a generic XML parser/serializer for filters
      XCOMMONS-650Add Velocity tool to manipulate exceptions
      XCOMMONS-129Add a tool or a method to an existing tool so that you can convert an Array to a List in Velocity
      XCOMMONS-582Add $escapetool.json for escaping JSON
      XCOMMONS-433Provide a generic JSON parser/serializer for filters
      XCOMMONS-412XAR tools tests fail to compile on Java 1.7

      Description

      Usage:

      #set($array = [1, 2, 3])
      $jsontool.serialize($array)
      #set($map = {'enabled': true, 'color': 'yellow', 'count': 13})
      $jsontool.serialize($map)
      

      but it should work with almost any Java object.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Marius Dumitru Florea
            Reporter:
            Marius Dumitru Florea
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: