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 EventHandler
consoleEventHandler()
abstract void
documentEnd()
The document end eventabstract void
documentStart(JSONValueType type)
The document start eventCharset
getCharacterSet()
String
getDataValue(JSONEvent event)
ParserSettings
getParserSettings()
abstract void
handleEvent(JSONEvent event)
abstract void
jsonArrayEnd(String key)
End of a JSONArrayabstract void
jsonArrayStart(String key)
Start of new JSONArray.abstract void
jsonObjectEnd(String key)
End of a JSONObjectabstract void
jsonObjectStart(String key)
Start of a new JSONObjectabstract void
newKey(String key)
void
setParserSettings(ParserSettings settings)
abstract void
valueBigDecimal(String key, BigDecimal value)
BigDecimal valueabstract void
valueBoolean(String key, boolean value)
Boolean valueabstract void
valueDouble(String key, Double value)
Double value valueabstract void
valueFloat(String key, Float value)
Float valueabstract void
valueInt(String key, Integer value)
Integer valueabstract void
valueLong(String key, Long value)
Long valueabstract void
valueNull(String key)
null valueabstract void
valueString(String key, String value)
String value
-
Constructor Details
-
EventHandler
public EventHandler()
-
-
Method Details
-
consoleEventHandler
-
setParserSettings
- Specified by:
setParserSettings
in interfaceConfigurable
-
getParserSettings
- Specified by:
getParserSettings
in interfaceConfigurable
-
getCharacterSet
- Specified by:
getCharacterSet
in interfaceJSONEventHandler
-
documentStart
Description copied from interface:JSONEventHandler
The document start event- Specified by:
documentStart
in interfaceJSONEventHandler
- Parameters:
type
- the document type, will either be JSONValueType.OBJECT orJSONValueType.ARRAY
-
documentEnd
public abstract void documentEnd()Description copied from interface:JSONEventHandler
The document end event- Specified by:
documentEnd
in interfaceJSONEventHandler
-
jsonArrayStart
Description copied from interface:JSONEventHandler
Start of new JSONArray.- Specified by:
jsonArrayStart
in interfaceJSONEventHandler
- Parameters:
key
- the parent key that is associated with the array
-
jsonArrayEnd
Description copied from interface:JSONEventHandler
End of a JSONArray- Specified by:
jsonArrayEnd
in interfaceJSONEventHandler
- Parameters:
key
- the parent key associated with the array
-
jsonObjectStart
Description copied from interface:JSONEventHandler
Start of a new JSONObject- Specified by:
jsonObjectStart
in interfaceJSONEventHandler
- Parameters:
key
- the parent key associated with the object
-
jsonObjectEnd
Description copied from interface:JSONEventHandler
End of a JSONObject- Specified by:
jsonObjectEnd
in interfaceJSONEventHandler
- Parameters:
key
- the parent key associated with this object
-
valueString
Description copied from interface:JSONEventHandler
String value- Specified by:
valueString
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueLong
Description copied from interface:JSONEventHandler
Long value- Specified by:
valueLong
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueInt
Description copied from interface:JSONEventHandler
Integer value- Specified by:
valueInt
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueBigDecimal
Description copied from interface:JSONEventHandler
BigDecimal value- Specified by:
valueBigDecimal
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueDouble
Description copied from interface:JSONEventHandler
Double value value- Specified by:
valueDouble
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueFloat
Description copied from interface:JSONEventHandler
Float value- Specified by:
valueFloat
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueBoolean
Description copied from interface:JSONEventHandler
Boolean value- Specified by:
valueBoolean
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this valuevalue
- the value
-
valueNull
Description copied from interface:JSONEventHandler
null value- Specified by:
valueNull
in interfaceJSONEventHandler
- Parameters:
key
- the key associated with this value
-
newKey
- Specified by:
newKey
in interfaceJSONEventHandler
-
handleEvent
- Specified by:
handleEvent
in interfaceJSONEventHandler
- Throws:
JSONEventParserException
-
getDataValue
-