程序包 org.jsfr.json

接口 ParsingContext

  • 所有已知实现类:
    SurfingContext

    public interface ParsingContext
    Created by Leo on 2015/3/22.
    • 方法详细资料

      • stop

        void stop()
        Stop parsing
      • isStopped

        boolean isStopped()
        返回:
        Whether parsing is stopped
      • pause

        void pause()
        Pause parsing
      • resume

        void resume()
        Resume parsing
      • isPaused

        boolean isPaused()
        返回:
        Whether parsing is paused
      • getJsonPath

        String getJsonPath()
        返回:
        The current JsonPath
      • getCurrentFieldName

        String getCurrentFieldName()
        返回:
        The current field name. Null if current position is not in json object
      • getCurrentArrayIndex

        int getCurrentArrayIndex()
        返回:
        The current index of json array. -1 if current position is not in json array
      • save

        void save​(String key,
                  Object value)
        Save a transient data during parsing
        参数:
        key - key
        value - value
      • load

        <T> T load​(String key,
                   Class<T> tClass)
        类型参数:
        T - type
        参数:
        key - key
        tClass - class to cast
        返回:
        Saved value
      • cast

        <T> T cast​(Object object,
                   Class<T> tClass)
        类型参数:
        T - type
        参数:
        object - object to cast
        tClass - type
        返回:
        casted object