Package com.fasterxml.jackson.jr.ob.impl

Examples of com.fasterxml.jackson.jr.ob.impl.BeanProperty


                case START_OBJECT:
                    {
                        bean = def.create();
                        for (; (t = _parser.nextToken()) == JsonToken.FIELD_NAME; ) {
                            String fieldName = _parser.getCurrentName();
                            BeanProperty prop = def.findProperty(fieldName);
                            if (prop == null) {
                                if (JSON.Feature.FAIL_ON_UNKNOWN_BEAN_PROPERTY.isEnabled(_features)) {
                                    throw JSONObjectException.from(_parser, "Unrecognized JSON property '"
                                            +fieldName+"' for Bean type "+type.getName());
                                }
                                _parser.nextToken();
                                _parser.skipChildren();
                                continue;
                            }
                            _parser.nextToken();
                            Class<?> rawType = prop.getType();
                            int propType = prop.getTypeId();
                            // need to dynamically resolve bean type refs
                            if (propType == TypeDetector.SER_UNKNOWN) {
                                propType = _typeDetector.findFullType(rawType);
                                if (propType != TypeDetector.SER_UNKNOWN) {
                                    prop.overridTypeId(propType);
                                }
                            }
                            Object value = _readBean(rawType, propType);
                            prop.setValueFor(bean, value);
                        }
                    }
                    break;
                default:
                }
View Full Code Here


        Map<String, BeanProperty> map = new HashMap<String, BeanProperty>();
        for (BeanProperty prop : props) {
            map.put(prop._name.getValue(), prop);
        }

        BeanProperty prop;

        prop = map.get("x");
        assertNotNull(prop);
        assertNotNull(prop._getMethod);
        assertNotNull(prop._setMethod);
View Full Code Here

        assertNotNull(props);
       
        if (props.size() != 1) {
            fail("Expected 1 properties, found "+props.size()+": "+props);
        }
        BeanProperty prop = props.values().iterator().next();

        assertNotNull(prop);
        assertNotNull(prop._setMethod);

        assertEquals(Long.class, prop.rawSetterType());
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.jr.ob.impl.BeanProperty

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.