Interface JsonEventListener
public interface JsonEventListener
Defines the contract to handle JsonEvents when building an object or array.
-
Method Summary
Modifier and TypeMethodDescriptionvoidTtriggered when reaching the end of an array.voidtriggered when the start of an array is encountered.voidonElementAdded(int index, Object element) Triggered when an element has been added to the current array.voidonError(JSONException jsone) Triggered when an exception is thrown.voidtriggered when reaching the end of an object.voidTriggered when the start of an object is encountered.voidonPropertySet(String key, Object value, boolean accumulated) Triggered when a property is set on an objectvoidTriggered when a warning is encountered.
-
Method Details
-
onArrayEnd
void onArrayEnd()Ttriggered when reaching the end of an array. -
onArrayStart
void onArrayStart()triggered when the start of an array is encountered. -
onElementAdded
Triggered when an element has been added to the current array.- Parameters:
index- the index where the element was addedelement- the added element
-
onError
Triggered when an exception is thrown.- Parameters:
jsone- the thrown exception
-
onObjectEnd
void onObjectEnd()triggered when reaching the end of an object. -
onObjectStart
void onObjectStart()Triggered when the start of an object is encountered. -
onPropertySet
-
onWarning
Triggered when a warning is encountered.- Parameters:
warning- the warning message
-