Class LazyJsonNode

java.lang.Object
io.micronaut.json.convert.LazyJsonNode
All Implemented Interfaces:
ReferenceCounted

@Internal public final class LazyJsonNode extends Object implements ReferenceCounted
Lazily parsed JsonNode.
  • Constructor Details

  • Method Details

    • parse

      public <T> T parse(JsonMapper mapper, Argument<T> type) throws IOException
      Parse this JSON to the given type.
      Type Parameters:
      T - The target type
      Parameters:
      mapper - The mapper to use for parsing
      type - The target type
      Returns:
      The parsed value
      Throws:
      IOException - A JsonSyntaxException or framework data binding exception
    • retain

      public LazyJsonNode retain()
      Description copied from interface: ReferenceCounted
      Retain an additional reference to this object. All retained references must be released, or there will be a leak.
      Specified by:
      retain in interface ReferenceCounted
      Returns:
      this
    • release

      public boolean release()
      Description copied from interface: ReferenceCounted
      Release a reference to this object.
      Specified by:
      release in interface ReferenceCounted
      Returns:
      Whether the reference has been released
    • tryRelease

      @Internal public void tryRelease()
      Try to release this node if it hasn't been released already.