Package org.codehaus.jackson.map.deser

Examples of org.codehaus.jackson.map.deser.SettableBeanProperty$CreatorProperty


        int len = _orderedPropertyNames.length;
        ArrayList<SettableBeanProperty> props = new ArrayList<SettableBeanProperty>(len);
        int i = 0;
       
        for (; i < len; ++i) {
            SettableBeanProperty prop = _beanProperties.find(_orderedPropertyNames[i].toString());
            if (prop == null) {
                break;
            }
            props.add(prop);
        }
View Full Code Here


        }
        if (_externalTypeIdHandler != null) {
            return deserializeWithExternalTypeId(jp, ctxt, bean);
        }
        JsonToken t = jp.getCurrentToken();
        SettableBeanProperty prop = _orderedProperties[0];
        // First: verify that first name is expected
        if (t == JsonToken.START_OBJECT) {
            if (!jp.nextFieldName(_orderedPropertyNames[0])) {
                return super.deserialize(jp,  ctxt, bean);
            }
            t = jp.nextToken();
        } else if (t != JsonToken.FIELD_NAME || !prop.getName().equals(jp.getCurrentName())) {
            return super.deserialize(jp,  ctxt, bean);
        }
        // and deserialize
        jp.nextToken();
        try {
            prop.deserializeAndSet(jp, ctxt, bean);
        } catch (Exception e) {
            wrapAndThrow(e, bean, prop.getName(), ctxt);
        }

        // then rest of properties
        for (int i = 1, len = _orderedProperties.length; i < len; ++i) {
            prop = _orderedProperties[i];
            if (!jp.nextFieldName(_orderedPropertyNames[i])) { // miss...
                if (jp.getCurrentToken() == JsonToken.END_OBJECT) {
                    break;
                }
                // we likely point to FIELD_NAME, so can just call parent impl
                return super.deserialize(jp, ctxt, bean);
            }
            jp.nextToken(); // skip field, returns value token
            try {
                prop.deserializeAndSet(jp, ctxt, bean);
            } catch (Exception e) {
                wrapAndThrow(e, bean, prop.getName(), ctxt);
            }
        }
        // also, need to ensure we get closing END_OBJECT...
        if (jp.nextToken() != JsonToken.END_OBJECT) {
            return super.deserialize(jp, ctxt, bean);
View Full Code Here

        final Object bean = _valueInstantiator.createUsingDefault();
        if (_injectables != null) {
            injectValues(ctxt, bean);
        }
        JsonToken t = jp.getCurrentToken();
        SettableBeanProperty prop = _orderedProperties[0];
        // First: verify that first name is expected
        if (t == JsonToken.START_OBJECT) {
            if (!jp.nextFieldName(_orderedPropertyNames[0])) {
                return super.deserialize(jp,  ctxt, bean);
            }
            t = jp.nextToken();
        } else if (t != JsonToken.FIELD_NAME || !prop.getName().equals(jp.getCurrentName())) {
            return super.deserialize(jp,  ctxt, bean);
        }
        // and deserialize
        jp.nextToken();
        try {
            prop.deserializeAndSet(jp, ctxt, bean);
        } catch (Exception e) {
            wrapAndThrow(e, bean, prop.getName(), ctxt);
        }

        // then rest of properties
        for (int i = 1, len = _orderedProperties.length; i < len; ++i) {
            prop = _orderedProperties[i];
            if (!jp.nextFieldName(_orderedPropertyNames[i])) { // miss...
                if (jp.getCurrentToken() == JsonToken.END_OBJECT) {
                    break;
                }
                // we likely point to FIELD_NAME, so can just call parent impl
                return super.deserialize(jp, ctxt, bean);
            }
            jp.nextToken(); // skip field, returns value token
            try {
                prop.deserializeAndSet(jp, ctxt, bean);
            } catch (Exception e) {
                wrapAndThrow(e, bean, prop.getName(), ctxt);
            }
        }
        // also, need to ensure we get closing END_OBJECT...
        if (jp.nextToken() != JsonToken.END_OBJECT) {
            return super.deserialize(jp, ctxt, bean);
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.deser.SettableBeanProperty$CreatorProperty

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.