public interface Builder
Modifier and Type | Method and Description |
---|---|
void |
close()
Method called to close builder, so that no more content
can be written.
|
String |
getContent()
Methid called to get the final content after closing the builder
|
void |
writeArrayFieldStart(String fieldName)
Convenience method for outputting a field entry ("member")
(that will contain a JSON Array value), and the START_ARRAY marker.
|
void |
writeBinary(byte[] data,
int offset,
int len)
Method that will output given chunk of binary data as base64
encoded, as a complete String value (surrounded by double quotes).
|
void |
writeBinaryField(String fieldName,
byte[] data)
Convenience method for outputting a field entry ("member")
that contains specified data in base64-encoded form.
|
void |
writeBoolean(boolean state)
Method for outputting literal boolean value (one of
Strings 'true' and 'false').
|
void |
writeBooleanField(String fieldName,
boolean value)
Convenience method for outputting a field entry ("member")
that has a boolean value.
|
void |
writeEndArray()
Method for writing closing marker of a Array.
|
void |
writeEndObject()
Method for writing closing marker of a Object value.
|
void |
writeField(String fieldName,
Object value,
String fieldType)
Convenience method for outputting a field entry ("member")
that has a String value.
|
void |
writeFieldName(String name)
Method for writing a field name.
|
void |
writeNumber(double number)
Method for outputting indicate JSON numeric value.
|
void |
writeNumber(int number)
Method for outputting given value as number.
|
void |
writeNumberField(String fieldName,
double value)
Convenience method for outputting a field entry ("member")
that has the specified numeric value.
|
void |
writeNumberField(String fieldName,
int value)
Convenience method for outputting a field entry ("member")
that has the specified numeric value.
|
void |
writeObjectFieldStart(String fieldName)
Convenience method for outputting a field entry ("member")
(that will contain a JSON Object value), and the START_OBJECT marker.
|
void |
writePrimitive(Object value,
String fieldType)
Convenience method for outputting a primitive
that has a primitive value.
|
void |
writeStartArray()
Method for writing start marker of a Array value.
|
void |
writeStartObject()
Method for writing starting marker of a Object value.
|
void |
writeString(String text)
Method for outputting a String value.
|
void |
writeStringField(String fieldName,
String value)
Convenience method for outputting a field entry ("member")
that has a String value.
|
void writeStartArray() throws IOException
IOException
void writeEndArray() throws IOException
IOException
void writeStartObject() throws IOException
IOException
void writeEndObject() throws IOException
IOException
void writeFieldName(String name) throws IOException
IOException
void writeString(String text) throws IOException
IOException
void writeBinary(byte[] data, int offset, int len) throws IOException
IOException
void writeNumber(int number) throws IOException
number
- Number value to writeIOException
void writeNumber(double number) throws IOException
number
- Number value to writeIOException
void writeBoolean(boolean state) throws IOException
IOException
void writeStringField(String fieldName, String value) throws IOException
writeFieldName(fieldName); writeString(value);
IOException
void writeField(String fieldName, Object value, String fieldType) throws IOException
writeFieldName(fieldName); writeString(value);
IOException
void writeBooleanField(String fieldName, boolean value) throws IOException
writeFieldName(fieldName); writeBoolean(value);
IOException
void writeNumberField(String fieldName, int value) throws IOException
writeFieldName(fieldName); writeNumber(value);
IOException
void writeNumberField(String fieldName, double value) throws IOException
writeFieldName(fieldName); writeNumber(value);
IOException
void writeBinaryField(String fieldName, byte[] data) throws IOException
writeFieldName(fieldName); writeBinary(value);
IOException
void writeArrayFieldStart(String fieldName) throws IOException
writeFieldName(fieldName); writeStartArray();Note: caller still has to take care to close the array (by calling {#link #writeEndArray}) after writing all values of the value Array.
IOException
void writeObjectFieldStart(String fieldName) throws IOException
writeFieldName(fieldName); writeStartObject();Note: caller still has to take care to close the Object (by calling {#link #writeEndObject}) after writing all entries of the value Object.
IOException
void close() throws IOException
IOException
String getContent() throws IOException
IOException
void writePrimitive(Object value, String fieldType) throws IOException
IOException
Copyright © 2020 WSO2. All rights reserved.