Interface IJsonWriter
- All Known Implementing Classes:
CompositeJsonWriter
,JsonWriter
public interface IJsonWriter
Interface describing a writer to write Json (JavaScript Object Notation) objects to a stream.
- Since:
- 7.0
- Author:
- J. Gorter, Jon van Leuven
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this (and its internal) writer.void
End appending an array.void
Begin appending an array.void
writeArrayStart
(String memberName) Begin appending an array with a name.void
writeMember
(String memberName) Appending a member.void
writeMember
(String memberName, boolean booleanValue) Append a member with a boolean value.void
writeMember
(String memberName, double doubleValue) Append a member with a double value.void
writeMember
(String memberName, long longValue) Append a member with a long value.void
writeMember
(String memberName, String strValue) Append a member with a string value.void
Append a member with a null value.void
End appending an object.void
Begin appending an object.void
writeObjectStart
(String memberName) Begin appending an object with a name.void
writeValue
(boolean booleanValue) Append a boolean value.void
writeValue
(double doubleValue) Append a double value.void
writeValue
(long longValue) Append a long value.void
writeValue
(String strValue) Append a string value.void
Append a null value.
-
Method Details
-
writeObjectStart
Begin appending an object.- Throws:
IOException
- If an I/O error occurs.
-
writeObjectStart
Begin appending an object with a name.- Parameters:
memberName
- The member name, may not be null or empty.- Throws:
IOException
- If an I/O error occurs.
-
writeObjectEnd
End appending an object.- Throws:
IOException
- If an I/O error occurs.
-
writeArrayStart
Begin appending an array.- Throws:
IOException
- If an I/O error occurs.
-
writeArrayStart
Begin appending an array with a name.- Parameters:
memberName
- The member name, may not be null or empty.- Throws:
IOException
- If an I/O error occurs.
-
writeArrayEnd
End appending an array.- Throws:
IOException
- If an I/O error occurs.
-
writeMember
Append a member with a long value.- Parameters:
memberName
- The member name, may not be null or empty.longValue
- The value of the member.- Throws:
IOException
- If an I/O error occurs.
-
writeMember
Appending a member.- Parameters:
memberName
- The member name, may not be null or empty.- Throws:
IOException
- If an I/O error occurs.
-
writeMember
void writeMember(String memberName, double doubleValue) throws IOException, IllegalArgumentException Append a member with a double value.- Parameters:
memberName
- The member name, may not be null or empty.doubleValue
- The value of the member.- Throws:
IOException
- If an I/O error occurs.IllegalArgumentException
- When the provided double value is NaN or Infinity.
-
writeMember
Append a member with a boolean value.- Parameters:
memberName
- The member name, may not be null or empty.booleanValue
- The value of the member.- Throws:
IOException
- If an I/O error occurs.
-
writeMember
Append a member with a string value.- Parameters:
memberName
- The member name, may not be null or empty.strValue
- The value of the member.- Throws:
IOException
- If an I/O error occurs.
-
writeNull
Append a member with a null value.- Parameters:
memberName
- The member name, may not be null or empty.- Throws:
IOException
- If an I/O error occurs.
-
writeValue
Append a long value.- Parameters:
longValue
- The value.- Throws:
IOException
- If an I/O error occurs.
-
writeValue
Append a double value.- Parameters:
doubleValue
- The value.- Throws:
IOException
- If an I/O error occurs.IllegalArgumentException
- When the provided double value is NaN or Infinity.
-
writeValue
Append a boolean value.- Parameters:
booleanValue
- The value.- Throws:
IOException
- If an I/O error occurs.
-
writeValue
Append a string value.- Parameters:
strValue
- The value.- Throws:
IOException
- If an I/O error occurs.
-
writeValueNull
Append a null value.- Throws:
IOException
- If an I/O error occurs.
-
close
Close this (and its internal) writer.- Throws:
IOException
- If an I/O error occurs.
-