接口 JsonObjectReader<T>

  • 类型参数:
    T - type of the target object
    所有已知实现类:
    GsonJsonObjectReader, JacksonJsonObjectReader

    public interface JsonObjectReader<T>
    Strategy interface for Json readers. Implementations are expected to use a streaming API in order to read Json objects one at a time.
    从以下版本开始:
    4.1
    作者:
    Mahmoud Ben Hassine
    • 方法概要

      所有方法 实例方法 抽象方法 默认方法 
      修饰符和类型方法说明
      default voidclose()
      Close the input resource.
      default voidopen​(org.springframework.core.io.Resource resource)
      Open the Json resource for reading.
      Tread()
      Read the next object in the Json resource if any.
    • 方法详细资料

      • open

        default void open​(org.springframework.core.io.Resource resource)
                   throws java.lang.Exception
        Open the Json resource for reading.
        参数:
        resource - the input resource
        抛出:
        java.lang.Exception - if unable to open the resource
      • read

        @Nullable
        T read()
        throws java.lang.Exception
        Read the next object in the Json resource if any.
        返回:
        the next object or null if the resource is exhausted
        抛出:
        java.lang.Exception - if unable to read the next object
      • close

        default void close()
                    throws java.lang.Exception
        Close the input resource.
        抛出:
        java.lang.Exception - if unable to close the input resource