Class JsonStructureToParserAdapter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, javax.json.stream.JsonParser

    public class JsonStructureToParserAdapter
    extends java.lang.Object
    implements javax.json.stream.JsonParser
    Adapter for JsonParser, that reads a JsonStructure content tree instead of JSON text. Yasson and jsonb API components are using JsonParser as its input API. This adapter allows deserialization of JsonStructure into java content tree using same components as when parsing JSON text.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface javax.json.stream.JsonParser

        javax.json.stream.JsonParser.Event
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonStructureToParserAdapter​(javax.json.JsonStructure structure)
      Creates new JsonStructure parser.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.math.BigDecimal getBigDecimal()  
      int getInt()  
      javax.json.stream.JsonLocation getLocation()  
      long getLong()  
      java.lang.String getString()  
      boolean hasNext()  
      boolean isIntegralNumber()  
      javax.json.stream.JsonParser.Event next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.json.stream.JsonParser

        getArray, getArrayStream, getObject, getObjectStream, getValue, getValueStream, skipArray, skipObject
    • Constructor Detail

      • JsonStructureToParserAdapter

        public JsonStructureToParserAdapter​(javax.json.JsonStructure structure)
        Creates new JsonStructure parser.
        Parameters:
        structure - json structure
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface javax.json.stream.JsonParser
      • next

        public javax.json.stream.JsonParser.Event next()
        Specified by:
        next in interface javax.json.stream.JsonParser
      • getString

        public java.lang.String getString()
        Specified by:
        getString in interface javax.json.stream.JsonParser
      • isIntegralNumber

        public boolean isIntegralNumber()
        Specified by:
        isIntegralNumber in interface javax.json.stream.JsonParser
      • getInt

        public int getInt()
        Specified by:
        getInt in interface javax.json.stream.JsonParser
      • getLong

        public long getLong()
        Specified by:
        getLong in interface javax.json.stream.JsonParser
      • getBigDecimal

        public java.math.BigDecimal getBigDecimal()
        Specified by:
        getBigDecimal in interface javax.json.stream.JsonParser
      • getLocation

        public javax.json.stream.JsonLocation getLocation()
        Specified by:
        getLocation in interface javax.json.stream.JsonParser
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface javax.json.stream.JsonParser