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;
 
     @Deprecated // since 2.2
     public ObjectIdValueProperty(ObjectIdReader objectIdReader) {
         this(objectIdReader.);
     }
     
     public ObjectIdValueProperty(ObjectIdReader objectIdReader,
             PropertyMetadata metadata)
     {
         super(objectIdReader.propertyNameobjectIdReader.getIdType(), metadata,
                 objectIdReader.getDeserializer());
          = objectIdReader;
     }
 
     protected ObjectIdValueProperty(ObjectIdValueProperty srcJsonDeserializer<?> deser)
     {
         super(srcdeser);
          = src._objectIdReader;
     }
 
     @Deprecated // since 2.3
     protected ObjectIdValueProperty(ObjectIdValueProperty srcPropertyName newName) {
         super(srcnewName);
          = src._objectIdReader;
     }
     
     @Deprecated // since 2.3
     protected ObjectIdValueProperty(ObjectIdValueProperty srcString newName) {
         this(srcnew PropertyName(newName));
     }
 
     @Override
     public ObjectIdValueProperty withName(PropertyName 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