Class JsonUtil


  • public final class JsonUtil
    extends Object
    • Field Detail

      • JSON_FACTORY

        public static final com.fasterxml.jackson.core.JsonFactory JSON_FACTORY
    • Method Detail

      • createJsonParser

        public static com.fasterxml.jackson.core.JsonParser createJsonParser​(com.fasterxml.jackson.core.JsonFactory factory,
                                                                             io.airlift.slice.Slice json)
                                                                      throws IOException
        Throws:
        IOException
      • createJsonGenerator

        public static com.fasterxml.jackson.core.JsonGenerator createJsonGenerator​(com.fasterxml.jackson.core.JsonFactory factory,
                                                                                   io.airlift.slice.SliceOutput output)
                                                                            throws IOException
        Throws:
        IOException
      • truncateIfNecessaryForErrorMessage

        public static String truncateIfNecessaryForErrorMessage​(io.airlift.slice.Slice json)
      • canCastToJson

        public static boolean canCastToJson​(Type type)
      • canCastFromJson

        public static boolean canCastFromJson​(Type type)
      • currentTokenAsVarchar

        public static io.airlift.slice.Slice currentTokenAsVarchar​(com.fasterxml.jackson.core.JsonParser parser)
                                                            throws IOException
        Throws:
        IOException
      • currentTokenAsBigint

        public static Long currentTokenAsBigint​(com.fasterxml.jackson.core.JsonParser parser)
                                         throws IOException
        Throws:
        IOException
      • currentTokenAsInteger

        public static Long currentTokenAsInteger​(com.fasterxml.jackson.core.JsonParser parser)
                                          throws IOException
        Throws:
        IOException
      • currentTokenAsSmallint

        public static Long currentTokenAsSmallint​(com.fasterxml.jackson.core.JsonParser parser)
                                           throws IOException
        Throws:
        IOException
      • currentTokenAsTinyint

        public static Long currentTokenAsTinyint​(com.fasterxml.jackson.core.JsonParser parser)
                                          throws IOException
        Throws:
        IOException
      • currentTokenAsDouble

        public static Double currentTokenAsDouble​(com.fasterxml.jackson.core.JsonParser parser)
                                           throws IOException
        Throws:
        IOException
      • currentTokenAsReal

        public static Long currentTokenAsReal​(com.fasterxml.jackson.core.JsonParser parser)
                                       throws IOException
        Throws:
        IOException
      • currentTokenAsBoolean

        public static Boolean currentTokenAsBoolean​(com.fasterxml.jackson.core.JsonParser parser)
                                             throws IOException
        Throws:
        IOException
      • currentTokenAsShortDecimal

        public static Long currentTokenAsShortDecimal​(com.fasterxml.jackson.core.JsonParser parser,
                                                      int precision,
                                                      int scale)
                                               throws IOException
        Throws:
        IOException
      • currentTokenAsLongDecimal

        public static io.airlift.slice.Slice currentTokenAsLongDecimal​(com.fasterxml.jackson.core.JsonParser parser,
                                                                       int precision,
                                                                       int scale)
                                                                throws IOException
        Throws:
        IOException