Package org.apache.johnzon.mapper
Class DynamicMappingGenerator.InObjectOrPrimitiveJsonGenerator
- java.lang.Object
-
- org.apache.johnzon.mapper.DynamicMappingGenerator.InObjectOrPrimitiveJsonGenerator
-
- All Implemented Interfaces:
jakarta.json.stream.JsonGenerator
,Closeable
,Flushable
,AutoCloseable
- Enclosing class:
- DynamicMappingGenerator
public static class DynamicMappingGenerator.InObjectOrPrimitiveJsonGenerator extends Object implements jakarta.json.stream.JsonGenerator
-
-
Field Summary
Fields Modifier and Type Field Description private jakarta.json.stream.JsonGenerator
delegate
private boolean
implicitStart
private String
keyIfNoObject
private int
nested
private DynamicMappingGenerator.WritingState
state
private Runnable
writeEnd
private Runnable
writeStart
-
Constructor Summary
Constructors Modifier Constructor Description private
InObjectOrPrimitiveJsonGenerator(jakarta.json.stream.JsonGenerator generator, Runnable writeStart, String keyName, Runnable writeEnd)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private jakarta.json.stream.JsonGenerator
doWriteEnd(boolean useDelegate)
void
endIfNeeded()
static void
endIfNeeded(jakarta.json.stream.JsonGenerator generator)
private void
ensureStart()
void
flush()
private boolean
isWritingPrimitive()
private jakarta.json.stream.JsonGenerator
unwrap(jakarta.json.stream.JsonGenerator delegate)
jakarta.json.stream.JsonGenerator
write(boolean value)
jakarta.json.stream.JsonGenerator
write(double value)
jakarta.json.stream.JsonGenerator
write(int value)
jakarta.json.stream.JsonGenerator
write(long value)
jakarta.json.stream.JsonGenerator
write(jakarta.json.JsonValue value)
jakarta.json.stream.JsonGenerator
write(String value)
jakarta.json.stream.JsonGenerator
write(String name, boolean value)
jakarta.json.stream.JsonGenerator
write(String name, double value)
jakarta.json.stream.JsonGenerator
write(String name, int value)
jakarta.json.stream.JsonGenerator
write(String name, long value)
jakarta.json.stream.JsonGenerator
write(String name, jakarta.json.JsonValue value)
jakarta.json.stream.JsonGenerator
write(String name, String value)
jakarta.json.stream.JsonGenerator
write(String name, BigDecimal value)
jakarta.json.stream.JsonGenerator
write(String name, BigInteger value)
jakarta.json.stream.JsonGenerator
write(BigDecimal value)
jakarta.json.stream.JsonGenerator
write(BigInteger value)
jakarta.json.stream.JsonGenerator
writeEnd()
jakarta.json.stream.JsonGenerator
writeKey(String name)
jakarta.json.stream.JsonGenerator
writeNull()
jakarta.json.stream.JsonGenerator
writeNull(String name)
jakarta.json.stream.JsonGenerator
writeStartArray()
jakarta.json.stream.JsonGenerator
writeStartArray(String name)
jakarta.json.stream.JsonGenerator
writeStartObject()
jakarta.json.stream.JsonGenerator
writeStartObject(String name)
-
-
-
Field Detail
-
delegate
private final jakarta.json.stream.JsonGenerator delegate
-
writeStart
private final Runnable writeStart
-
writeEnd
private final Runnable writeEnd
-
keyIfNoObject
private final String keyIfNoObject
-
state
private DynamicMappingGenerator.WritingState state
-
nested
private int nested
-
implicitStart
private boolean implicitStart
-
-
Method Detail
-
ensureStart
private void ensureStart()
-
writeStartObject
public jakarta.json.stream.JsonGenerator writeStartObject()
- Specified by:
writeStartObject
in interfacejakarta.json.stream.JsonGenerator
-
writeStartObject
public jakarta.json.stream.JsonGenerator writeStartObject(String name)
- Specified by:
writeStartObject
in interfacejakarta.json.stream.JsonGenerator
-
writeStartArray
public jakarta.json.stream.JsonGenerator writeStartArray()
- Specified by:
writeStartArray
in interfacejakarta.json.stream.JsonGenerator
-
writeStartArray
public jakarta.json.stream.JsonGenerator writeStartArray(String name)
- Specified by:
writeStartArray
in interfacejakarta.json.stream.JsonGenerator
-
writeKey
public jakarta.json.stream.JsonGenerator writeKey(String name)
- Specified by:
writeKey
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, jakarta.json.JsonValue value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, String value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, BigInteger value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, BigDecimal value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, int value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, long value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, double value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String name, boolean value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
writeNull
public jakarta.json.stream.JsonGenerator writeNull(String name)
- Specified by:
writeNull
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(jakarta.json.JsonValue value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(String value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(BigDecimal value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(BigInteger value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(int value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(long value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(double value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
write
public jakarta.json.stream.JsonGenerator write(boolean value)
- Specified by:
write
in interfacejakarta.json.stream.JsonGenerator
-
writeNull
public jakarta.json.stream.JsonGenerator writeNull()
- Specified by:
writeNull
in interfacejakarta.json.stream.JsonGenerator
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacejakarta.json.stream.JsonGenerator
-
flush
public void flush()
-
writeEnd
public jakarta.json.stream.JsonGenerator writeEnd()
- Specified by:
writeEnd
in interfacejakarta.json.stream.JsonGenerator
-
doWriteEnd
private jakarta.json.stream.JsonGenerator doWriteEnd(boolean useDelegate)
-
unwrap
private jakarta.json.stream.JsonGenerator unwrap(jakarta.json.stream.JsonGenerator delegate)
-
endIfNeeded
public void endIfNeeded()
-
isWritingPrimitive
private boolean isWritingPrimitive()
-
endIfNeeded
public static void endIfNeeded(jakarta.json.stream.JsonGenerator generator)
-
-