Class EventHandler
java.lang.Object
org.ghotibeaun.json.parser.jep.eventhandler.EventHandler
- All Implemented Interfaces:
Configurable,JSONEventHandler
- Direct Known Subclasses:
ConsoleEventHandler,StackEventHandler
public abstract class EventHandler extends Object implements JSONEventHandler
-
Constructor Summary
Constructors Constructor Description EventHandler() -
Method Summary
Modifier and Type Method Description static EventHandlerconsoleEventHandler()abstract voiddocumentEnd()The document end eventabstract voiddocumentStart(JSONValueType type)The document start eventCharsetgetCharacterSet()StringgetDataValue(JSONEvent event)ParserSettingsgetParserSettings()abstract voidhandleEvent(JSONEvent event)abstract voidjsonArrayEnd(String key)End of a JSONArrayabstract voidjsonArrayStart(String key)Start of new JSONArray.abstract voidjsonObjectEnd(String key)End of a JSONObjectabstract voidjsonObjectStart(String key)Start of a new JSONObjectabstract voidnewKey(String key)voidsetParserSettings(ParserSettings settings)abstract voidvalueBigDecimal(String key, BigDecimal value)BigDecimal valueabstract voidvalueBoolean(String key, boolean value)Boolean valueabstract voidvalueDouble(String key, Double value)Double value valueabstract voidvalueFloat(String key, Float value)Float valueabstract voidvalueInt(String key, Integer value)Integer valueabstract voidvalueLong(String key, Long value)Long valueabstract voidvalueNull(String key)null valueabstract voidvalueString(String key, String value)String value
-
Constructor Details
-
EventHandler
public EventHandler()
-
-
Method Details
-
consoleEventHandler
-
setParserSettings
- Specified by:
setParserSettingsin interfaceConfigurable
-
getParserSettings
- Specified by:
getParserSettingsin interfaceConfigurable
-
getCharacterSet
- Specified by:
getCharacterSetin interfaceJSONEventHandler
-
documentStart
Description copied from interface:JSONEventHandlerThe document start event- Specified by:
documentStartin interfaceJSONEventHandler- Parameters:
type- the document type, will either be JSONValueType.OBJECT orJSONValueType.ARRAY
-
documentEnd
public abstract void documentEnd()Description copied from interface:JSONEventHandlerThe document end event- Specified by:
documentEndin interfaceJSONEventHandler
-
jsonArrayStart
Description copied from interface:JSONEventHandlerStart of new JSONArray.- Specified by:
jsonArrayStartin interfaceJSONEventHandler- Parameters:
key- the parent key that is associated with the array
-
jsonArrayEnd
Description copied from interface:JSONEventHandlerEnd of a JSONArray- Specified by:
jsonArrayEndin interfaceJSONEventHandler- Parameters:
key- the parent key associated with the array
-
jsonObjectStart
Description copied from interface:JSONEventHandlerStart of a new JSONObject- Specified by:
jsonObjectStartin interfaceJSONEventHandler- Parameters:
key- the parent key associated with the object
-
jsonObjectEnd
Description copied from interface:JSONEventHandlerEnd of a JSONObject- Specified by:
jsonObjectEndin interfaceJSONEventHandler- Parameters:
key- the parent key associated with this object
-
valueString
Description copied from interface:JSONEventHandlerString value- Specified by:
valueStringin interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueLong
Description copied from interface:JSONEventHandlerLong value- Specified by:
valueLongin interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueInt
Description copied from interface:JSONEventHandlerInteger value- Specified by:
valueIntin interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueBigDecimal
Description copied from interface:JSONEventHandlerBigDecimal value- Specified by:
valueBigDecimalin interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueDouble
Description copied from interface:JSONEventHandlerDouble value value- Specified by:
valueDoublein interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueFloat
Description copied from interface:JSONEventHandlerFloat value- Specified by:
valueFloatin interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueBoolean
Description copied from interface:JSONEventHandlerBoolean value- Specified by:
valueBooleanin interfaceJSONEventHandler- Parameters:
key- the key associated with this valuevalue- the value
-
valueNull
Description copied from interface:JSONEventHandlernull value- Specified by:
valueNullin interfaceJSONEventHandler- Parameters:
key- the key associated with this value
-
newKey
- Specified by:
newKeyin interfaceJSONEventHandler
-
handleEvent
- Specified by:
handleEventin interfaceJSONEventHandler- Throws:
JSONEventParserException
-
getDataValue
-