Class LazyJsonNode

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

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

    • LazyJsonNode

      public LazyJsonNode(@NonNull @NonNull io.micronaut.core.io.buffer.ByteBuffer<?> buffer)
  • Method Details

    • parse

      public <T> T parse(JsonMapper mapper, io.micronaut.core.type.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()
      Specified by:
      retain in interface io.micronaut.core.io.buffer.ReferenceCounted
    • release

      public boolean release()
      Specified by:
      release in interface io.micronaut.core.io.buffer.ReferenceCounted
    • tryRelease

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