Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.jackson.databind.deser.impl;
  
  
  
Specialized com.fasterxml.jackson.databind.deser.SettableBeanProperty implementation used for virtual property that represents Object Id that is used for some POJO types (or properties).
 
 public final class ObjectIdValueProperty
     extends SettableBeanProperty
 {
     private static final long serialVersionUID = 1L;
 
     protected final ObjectIdReader _objectIdReader;
     
     public ObjectIdValueProperty(ObjectIdReader objectIdReader)
     {
         super(objectIdReader.propertyNameobjectIdReader.idTypenullnull);
          = objectIdReader;
          = objectIdReader.deserializer;
     }
 
     protected ObjectIdValueProperty(ObjectIdValueProperty srcJsonDeserializer<?> deser)
     {
         super(srcdeser);
          = src._objectIdReader;
     }
 
     protected ObjectIdValueProperty(ObjectIdValueProperty srcString newName) {
         super(srcnewName);
          = src._objectIdReader;
     }
 
     @Override
     public ObjectIdValueProperty withName(String newName) {
         return new ObjectIdValueProperty(thisnewName);
     }
 
     @Override
         return new ObjectIdValueProperty(thisdeser);
     }
     
     // // // BeanProperty impl
     
     @Override
     public <A extends Annotation> A getAnnotation(Class<A> acls) {
         return null;
     }
 
     @Override public AnnotatedMember getMember() {  return null; }
 
     /*
     /**********************************************************
     /* Deserialization methods
     /**********************************************************
      */
 
     @Override
     public void deserializeAndSet(JsonParser jpDeserializationContext ctxt,
             Object instance)
         throws IOExceptionJsonProcessingException
     {
     	deserializeSetAndReturn(jpctxtinstance);
     }
 
     @Override
     		DeserializationContext ctxtObject instance)
         throws IOExceptionJsonProcessingException
     {
         // note: no null checks (unlike usually); deserializer should fail if one found
         Object id = .deserialize(jpctxt);
         ReadableObjectId roid = ctxt.findObjectId(id.);
         roid.bindItem(instance);
         // also: may need to set a property value as well
         SettableBeanProperty idProp = .;
         if (idProp != null) {
             return idProp.setAndReturn(instanceid);
         }
         return instance;
     }
     
     
     @Override
     public void set(Object instanceObject valuethrows IOException {
     	setAndReturn(instancevalue);
     }
 
     @Override
    public Object setAndReturn(Object instanceObject value)
        throws IOException
    {
        if (idProp == null) {
            throw new UnsupportedOperationException(
                    "Should not call set() on ObjectIdProperty that has no SettableBeanProperty");
        }
        return idProp.setAndReturn(instancevalue);
    }
New to GrepCode? Check out our FAQ X