All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.signalfx.shaded.fasterxml.jackson.jr.ob.comp.ArrayComposer Maven / Gradle / Ivy

There is a newer version: 1.0.45
Show newest version
package com.signalfx.shaded.fasterxml.jackson.jr.ob.comp;

import java.io.IOException;

import com.signalfx.shaded.fasterxml.jackson.core.JsonGenerator;
import com.signalfx.shaded.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