Class PlaceholderEnabledJsonNodeFactory

java.lang.Object
com.fasterxml.jackson.databind.node.JsonNodeFactory
org.jmxtrans.embedded.util.json.PlaceholderEnabledJsonNodeFactory
All Implemented Interfaces:
com.fasterxml.jackson.databind.node.JsonNodeCreator, Serializable

public class PlaceholderEnabledJsonNodeFactory
extends com.fasterxml.jackson.databind.node.JsonNodeFactory
Property placeholder / substitution enabled JsonNodeFactory. Each JSON text value is processed by the PropertyPlaceholderResolver before building a TextNode. Inspired by Spring Framework PropertyPlaceHolder and by Jakarta Digester Substitution.
Author:
Cyrille Le Clerc
See Also:
Serialized Form
  • Field Summary

    Fields inherited from class com.fasterxml.jackson.databind.node.JsonNodeFactory

    instance
  • Constructor Summary

    Constructors
    Constructor Description
    PlaceholderEnabledJsonNodeFactory()
    Default constructor
    PlaceholderEnabledJsonNodeFactory​(boolean bigDecimalExact)
    Main constructor
  • Method Summary

    Modifier and Type Method Description
    com.fasterxml.jackson.databind.node.TextNode textNode​(String text)  

    Methods inherited from class com.fasterxml.jackson.databind.node.JsonNodeFactory

    _inIntRange, arrayNode, arrayNode, binaryNode, binaryNode, booleanNode, nullNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, numberNode, objectNode, pojoNode, rawValueNode, withExactBigDecimals

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlaceholderEnabledJsonNodeFactory

      public PlaceholderEnabledJsonNodeFactory​(boolean bigDecimalExact)
      Main constructor

      The only argument to this constructor is a boolean telling whether DecimalNode instances must be built with exact representations of BigDecimal instances.

      This has quite an influence since, for instance, a BigDecimal (and, therefore, a DecimalNode) constructed from input string "1.0" and another constructed with input string "1.00" will not be equal, since their scale differs (1 in the first case, 2 in the second case).

      Note that setting the argument to true does not guarantee a strict inequality between JSON representations: input texts "0.1" and "1e-1", for instance, yield two equivalent BigDecimal instances since they have the same scale (1).

      The no-arg constructor (and the default JsonNodeFactory.instance) calls this constructor with false as an argument.

      Parameters:
      bigDecimalExact - see description
      See Also:
      BigDecimal
    • PlaceholderEnabledJsonNodeFactory

      public PlaceholderEnabledJsonNodeFactory()
      Default constructor

      This calls PlaceholderEnabledJsonNodeFactory(boolean) with false as an argument.

  • Method Details

    • textNode

      public com.fasterxml.jackson.databind.node.TextNode textNode​(String text)
      Specified by:
      textNode in interface com.fasterxml.jackson.databind.node.JsonNodeCreator
      Overrides:
      textNode in class com.fasterxml.jackson.databind.node.JsonNodeFactory