Package org.h2.util.json
Class JSONValueTarget
- java.lang.Object
-
- org.h2.util.json.JSONTarget<JSONValue>
-
- org.h2.util.json.JSONValueTarget
-
public final class JSONValueTarget extends JSONTarget<JSONValue>
JSON value target.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
memberName
private java.util.ArrayDeque<java.lang.String>
names
private boolean
needSeparator
private JSONValue
result
private java.util.ArrayDeque<JSONValue>
stack
-
Constructor Summary
Constructors Constructor Description JSONValueTarget()
Creates new instance of JSON value target.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
afterValue(JSONValue value)
private void
beforeValue()
void
endArray()
End of the current array.void
endObject()
End of the current object.JSONValue
getResult()
Returns the result.boolean
isPropertyExpected()
Returns whether member's name or the end of the current object is expected.boolean
isValueSeparatorExpected()
Returns whether value separator expected before the next member or value.void
member(java.lang.String name)
Name of a member.void
startArray()
Start of an array.void
startObject()
Start of an object.void
valueFalse()
Parse "false".void
valueNull()
Parse "null".void
valueNumber(java.math.BigDecimal number)
A number value.void
valueString(java.lang.String string)
A string value.void
valueTrue()
Parse "true".
-
-
-
Method Detail
-
startObject
public void startObject()
Description copied from class:JSONTarget
Start of an object.- Specified by:
startObject
in classJSONTarget<JSONValue>
-
endObject
public void endObject()
Description copied from class:JSONTarget
End of the current object.- Specified by:
endObject
in classJSONTarget<JSONValue>
-
startArray
public void startArray()
Description copied from class:JSONTarget
Start of an array.- Specified by:
startArray
in classJSONTarget<JSONValue>
-
endArray
public void endArray()
Description copied from class:JSONTarget
End of the current array.- Specified by:
endArray
in classJSONTarget<JSONValue>
-
member
public void member(java.lang.String name)
Description copied from class:JSONTarget
Name of a member.- Specified by:
member
in classJSONTarget<JSONValue>
- Parameters:
name
- the name
-
valueNull
public void valueNull()
Description copied from class:JSONTarget
Parse "null".null
value.- Specified by:
valueNull
in classJSONTarget<JSONValue>
-
valueFalse
public void valueFalse()
Description copied from class:JSONTarget
Parse "false".false
value.- Specified by:
valueFalse
in classJSONTarget<JSONValue>
-
valueTrue
public void valueTrue()
Description copied from class:JSONTarget
Parse "true".true
value.- Specified by:
valueTrue
in classJSONTarget<JSONValue>
-
valueNumber
public void valueNumber(java.math.BigDecimal number)
Description copied from class:JSONTarget
A number value.- Specified by:
valueNumber
in classJSONTarget<JSONValue>
- Parameters:
number
- the number
-
valueString
public void valueString(java.lang.String string)
Description copied from class:JSONTarget
A string value.- Specified by:
valueString
in classJSONTarget<JSONValue>
- Parameters:
string
- the string
-
beforeValue
private void beforeValue()
-
afterValue
private void afterValue(JSONValue value)
-
isPropertyExpected
public boolean isPropertyExpected()
Description copied from class:JSONTarget
Returns whether member's name or the end of the current object is expected.- Specified by:
isPropertyExpected
in classJSONTarget<JSONValue>
- Returns:
true
if it is,false
otherwise
-
isValueSeparatorExpected
public boolean isValueSeparatorExpected()
Description copied from class:JSONTarget
Returns whether value separator expected before the next member or value.- Specified by:
isValueSeparatorExpected
in classJSONTarget<JSONValue>
- Returns:
true
if it is,false
otherwise
-
getResult
public JSONValue getResult()
Description copied from class:JSONTarget
Returns the result.- Specified by:
getResult
in classJSONTarget<JSONValue>
- Returns:
- the result
-
-