com.fasterxml.jackson.jr.ob.comp.ArrayComposer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-jr-objects Show documentation
Show all versions of jackson-jr-objects Show documentation
Simple data-binding that builds directly on jackson-core (streaming),
has no other dependencies, and provides additional builder-style content generator
package com.fasterxml.jackson.jr.ob.comp;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
public class ArrayComposer
extends SequenceComposer>
{
protected final PARENT _parent;
public ArrayComposer(PARENT parent, JsonGenerator g) {
super(g);
_parent = parent;
}
/*
/**********************************************************************
/* Abstract method impls
/**********************************************************************
*/
@Override
protected ArrayComposer _start() throws IOException, JsonProcessingException {
_generator.writeStartArray();
return this;
}
@Override
protected Object _finish() throws IOException, JsonProcessingException {
if (_open) {
_open = false;
_generator.writeEndArray();
}
return null;
}
/*
/**********************************************************************
/* Compose methods, structures
/**********************************************************************
*/
public PARENT end()
throws IOException, JsonProcessingException
{
_closeChild();
if (_open) {
_open = false;
_generator.writeEndArray();
_parent._childClosed();
}
return _parent;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy