Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonStreamContext


         */
        // First: let's see that we still have buffers...
        if (_outputBuffer != null
                && isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) {
            while (true) {
                JsonStreamContext ctxt = getOutputContext();
                if (ctxt.inArray()) {
                    writeEndArray();
                } else if (ctxt.inObject()) {
                    writeEndObject();
                } else {
                    break;
                }
            }
View Full Code Here


*/
public class PoolEventFilter extends HateoasBeanPropertyFilter {

    public boolean isSerializable(Object obj, JsonGenerator jsonGenerator,
            SerializerProvider serializerProvider, PropertyWriter writer) {
        JsonStreamContext context = jsonGenerator.getOutputContext();

        // Special case list of entitlements to show full json
        if (context.getParent() != null && context.getParent().getParent() != null &&
                context.getParent().getParent().getParent() != null &&
                context.getParent().inObject() &&
                context.getParent().getParent().getParent().inRoot()) {
            return true;
        }
        return super.isSerializable(obj, jsonGenerator, serializerProvider, writer);
    }
View Full Code Here

*/
public class HateoasBeanPropertyFilter extends JsonBeanPropertyFilter {

    public boolean isSerializable(Object obj, JsonGenerator jsonGenerator,
        SerializerProvider serializerProvider, PropertyWriter writer) {
        JsonStreamContext context = jsonGenerator.getOutputContext();

        if ((context.getParent() != null) && (context.getParent().inArray())) {
            // skip annotated fields if within array:
            if (!annotationPresent(obj, writer.getName(), HateoasArrayExclude.class)) {
                return true;
            }
        }
        // Check if we should trigger reduced HATEOAS serialization for a nested object by
        // looking for the annotation on the fields getter:
        else if ((context.getParent() != null) && (context.getParent().inObject())) {
            if (annotationPresent(obj, writer.getName(), HateoasInclude.class)) {
                return true;
            }
        }
        else {
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.core.JsonStreamContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.