Class JsonRenderer
- java.lang.Object
-
- com.microstrategy.web.blocks.renderers.AbstractRenderer
-
- com.microstrategy.web.blocks.renderers.JsonRenderer
-
- All Implemented Interfaces:
Renderer
- Direct Known Subclasses:
DiagnosticJsonRenderer
public class JsonRenderer extends AbstractRenderer
This class is used to render the contents of a Block in JavaScript Object Notation (JSON) format.- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_ANNOTATION_EXPRESSION
static java.lang.String
PROPERTY_ANNOTATION_GROUP
-
Fields inherited from class com.microstrategy.web.blocks.renderers.AbstractRenderer
contentEncoders
-
-
Constructor Summary
Constructors Constructor Description JsonRenderer()
Default no-args constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericJsonGenerator
buildJsonGeneratorTree(Block block, BlockContext bContext)
Construct a JSON Generator Tree from the Block tree.MarkupOutput
generateMarkup(BlockContext bContext, Block block)
Generate the markup representation of the specified Block.protected java.util.Comparator<BlockProperty>
getBlockPropertyComparator()
-
Methods inherited from class com.microstrategy.web.blocks.renderers.AbstractRenderer
setEncoderChain
-
-
-
-
Field Detail
-
PROPERTY_ANNOTATION_GROUP
public static final java.lang.String PROPERTY_ANNOTATION_GROUP
- See Also:
- Constant Field Values
-
PROPERTY_ANNOTATION_EXPRESSION
public static final java.lang.String PROPERTY_ANNOTATION_EXPRESSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateMarkup
public MarkupOutput generateMarkup(BlockContext bContext, Block block) throws java.lang.Exception
Description copied from interface:Renderer
Generate the markup representation of the specified Block.- Parameters:
bContext
- TheBlockContext
object that controls how BlockProperty values are expanded and Blocks are serialized.block
- TheBlock
to generate markup for.- Returns:
- A new
MarkupOutput
object that contains the generated markup. - Throws:
java.lang.Exception
- If an error occurs in the process of generating the markup.
-
buildJsonGeneratorTree
public GenericJsonGenerator buildJsonGeneratorTree(Block block, BlockContext bContext)
Construct a JSON Generator Tree from the Block tree.- Parameters:
block
- The Block tree to convert into a JSON Generator.bContext
- TheBlockContext
which defines how dynamic Block property values are computed.- Returns:
- A
GenericJsonGenerator
that holds the contents of the Block tree. - Since:
- MicroStrategy Web 9.0.1
-
getBlockPropertyComparator
protected java.util.Comparator<BlockProperty> getBlockPropertyComparator()
-
-