public final class JSONByteArrayTarget extends JSONTarget<byte[]>
Constructor and Description |
---|
JSONByteArrayTarget()
Creates new instance of JSON byte array target.
|
Modifier and Type | Method and Description |
---|---|
static java.io.ByteArrayOutputStream |
encodeString(java.io.ByteArrayOutputStream baos,
java.lang.String s)
Encodes a JSON string and appends it to the specified output stream.
|
void |
endArray()
End of the current array.
|
void |
endObject()
End of the current object.
|
byte[] |
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".
|
public JSONByteArrayTarget()
public static java.io.ByteArrayOutputStream encodeString(java.io.ByteArrayOutputStream baos, java.lang.String s)
baos
- the output stream to append tos
- the string to encodepublic void startObject()
JSONTarget
startObject
in class JSONTarget<byte[]>
public void endObject()
JSONTarget
endObject
in class JSONTarget<byte[]>
public void startArray()
JSONTarget
startArray
in class JSONTarget<byte[]>
public void endArray()
JSONTarget
endArray
in class JSONTarget<byte[]>
public void member(java.lang.String name)
JSONTarget
member
in class JSONTarget<byte[]>
name
- the namepublic void valueNull()
JSONTarget
null
value.valueNull
in class JSONTarget<byte[]>
public void valueFalse()
JSONTarget
false
value.valueFalse
in class JSONTarget<byte[]>
public void valueTrue()
JSONTarget
true
value.valueTrue
in class JSONTarget<byte[]>
public void valueNumber(java.math.BigDecimal number)
JSONTarget
valueNumber
in class JSONTarget<byte[]>
number
- the numberpublic void valueString(java.lang.String string)
JSONTarget
valueString
in class JSONTarget<byte[]>
string
- the stringpublic boolean isPropertyExpected()
JSONTarget
isPropertyExpected
in class JSONTarget<byte[]>
true
if it is, false
otherwisepublic boolean isValueSeparatorExpected()
JSONTarget
isValueSeparatorExpected
in class JSONTarget<byte[]>
true
if it is, false
otherwisepublic byte[] getResult()
JSONTarget
getResult
in class JSONTarget<byte[]>