Package net.sf.json.util
Interface JsonEventListener
-
public interface JsonEventListenerDefines the contract to handle JsonEvents when building an object or array.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonArrayEnd()Ttriggered when reaching the end of an array.voidonArrayStart()triggered when the start of an array is encountered.voidonElementAdded(int index, java.lang.Object element)Triggered when an element has been added to the current array.voidonError(JSONException jsone)Triggered when an exception is thrown.voidonObjectEnd()triggered when reaching the end of an object.voidonObjectStart()Triggered when the start of an object is encountered.voidonPropertySet(java.lang.String key, java.lang.Object value, boolean accumulated)Triggered when a property is set on an objectvoidonWarning(java.lang.String warning)Triggered when a warning is encountered.
-
-
-
Method Detail
-
onArrayEnd
void onArrayEnd()
Ttriggered when reaching the end of an array.
-
onArrayStart
void onArrayStart()
triggered when the start of an array is encountered.
-
onElementAdded
void onElementAdded(int index, java.lang.Object element)Triggered when an element has been added to the current array.- Parameters:
index- the index where the element was addedelement- the added element
-
onError
void onError(JSONException jsone)
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
void onPropertySet(java.lang.String key, java.lang.Object value, boolean accumulated)Triggered when a property is set on an object- Parameters:
key- the name of the propertyvalue- the value of the propertyaccumulated- if the value has been accumulated over 'key'
-
onWarning
void onWarning(java.lang.String warning)
Triggered when a warning is encountered.- Parameters:
warning- the warning message
-
-