Log Message: |
PIVOT-960: Add macro processing capability to JSONSerializer.
This provides a very general way to use constant definitions inside a style
sheet (for instance) or to compose values from parts defined separately.
Macros are defined used "#define NAME VALUE" and undefined with "#undef NAME".
Macros are expanded using "${NAME}" and can be recursively defined (that is,
one macro is defined in terms of another, such as:
#define TWO 2
#define ZERO 0
#define TWENTY ${TWO}${ZERO}
...
padding : ${TWENTY}
will expand to:
padding : 20
Updating the JSONSerializerTest to more thoroughly test the various macro
definitions and expansions, using an update "map.json" with a number of
macros defined in it.
The main program is "MacroReader.java" which is just a Reader that can be
combined with any other Reader to add macro capabilities to any other text
stream (such as XML, CSV, etc). For now we have only added it to JSONSerializer.
|