Package net.sf.json.util
Interface JsonEventListener
public interface JsonEventListener
Defines the contract to handle JsonEvents when building an object or array.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Ttriggered when reaching the end of an array.void
triggered when the start of an array is encountered.void
onElementAdded
(int index, Object element) Triggered when an element has been added to the current array.void
onError
(JSONException jsone) Triggered when an exception is thrown.void
triggered when reaching the end of an object.void
Triggered when the start of an object is encountered.void
onPropertySet
(String key, Object value, boolean accumulated) Triggered when a property is set on an objectvoid
Triggered 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
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
Triggered when a warning is encountered.- Parameters:
warning
- the warning message
-