|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.json.util.CycleDetectionStrategy
public abstract class 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:
Field Summary | |
---|---|
static CycleDetectionStrategy |
LENIENT
Returns empty array and null object |
static CycleDetectionStrategy |
STRICT
Throws a JSONException |
Constructor Summary | |
---|---|
CycleDetectionStrategy()
|
Method Summary | |
---|---|
abstract JSONArray |
handleRepeatedReferenceAsArray(Object reference)
Handle a repeated reference Must return a valid JSONArray or null. |
abstract JSONObject |
handleRepeatedReferenceAsObject(Object reference)
Handle a repeated reference Must return a valid JSONObject or null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final CycleDetectionStrategy LENIENT
public static final CycleDetectionStrategy STRICT
Constructor Detail |
---|
public CycleDetectionStrategy()
Method Detail |
---|
public abstract JSONArray handleRepeatedReferenceAsArray(Object reference)
reference
- the repeated reference.public abstract JSONObject handleRepeatedReferenceAsObject(Object reference)
reference
- the repeated reference.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |