程序包 com.sh.json.util
类 CycleDetectionStrategy
java.lang.Object
com.sh.json.util.CycleDetectionStrategy
Base class for cycle detection in a hierarchy.
The JSON spec forbides cycles in a hierarchy and most parsers will raise and error when a cycle is detected. This class defines a contract for handling those cycles and two base implementations:
The JSON spec forbides cycles in a hierarchy and most parsers will raise and error when a cycle is detected. This class defines a contract for handling those cycles and two base implementations:
- STRICT - will throw a JSONException if a cycle is found.
- LENIENT - will return an empty array or null object if a cycle is found.
-
字段概要
字段修饰符和类型字段说明static final JSONArraystatic final JSONObjectstatic final CycleDetectionStrategyReturns empty array and null objectstatic final CycleDetectionStrategyReturns a special object (IGNORE_PROPERTY_OBJ) that indicates the entire property should be ignoredstatic final CycleDetectionStrategyThrows a JSONException -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract JSONArrayhandleRepeatedReferenceAsArray(Object reference) Handle a repeated reference
Must return a valid JSONArray or null.abstract JSONObjecthandleRepeatedReferenceAsObject(Object reference) Handle a repeated reference
Must return a valid JSONObject or null.
-
字段详细资料
-
IGNORE_PROPERTY_ARR
-
IGNORE_PROPERTY_OBJ
-
LENIENT
Returns empty array and null object -
NOPROP
Returns a special object (IGNORE_PROPERTY_OBJ) that indicates the entire property should be ignored -
STRICT
Throws a JSONException
-
-
构造器详细资料
-
CycleDetectionStrategy
public CycleDetectionStrategy()
-
-
方法详细资料
-
handleRepeatedReferenceAsArray
Handle a repeated reference
Must return a valid JSONArray or null.- 参数:
reference- the repeated reference.
-
handleRepeatedReferenceAsObject
Handle a repeated reference
Must return a valid JSONObject or null.- 参数:
reference- the repeated reference.
-