Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.jackson.databind.deser.impl;
  
  
This concrete sub-class implements property that is set directly assigning to a Field.
 
 public final class FieldProperty
     extends SettableBeanProperty
 {
     private static final long serialVersionUID = 1L;

    
Transient since there is no need to persist; only needed during construction of objects.
 
     protected final AnnotatedField _annotated;

    
Actual field to set when deserializing this property.
 
     protected final transient Field _field;
     
     public FieldProperty(BeanPropertyDefinition propDefJavaType type,
             TypeDeserializer typeDeserAnnotations contextAnnotationsAnnotatedField field)
     {
         super(propDeftypetypeDesercontextAnnotations);
          = field;
          = field.getAnnotated();
     }
 
     protected FieldProperty(FieldProperty srcJsonDeserializer<?> deser) {
         super(srcdeser);
          = src._annotated;
          = src._field;
     }
 
     protected FieldProperty(FieldProperty srcString newName) {
         super(srcnewName);
          = src._annotated;
          = src._field;
     }

    
Constructor used for JDK Serialization when reading persisted object
 
     protected FieldProperty(FieldProperty srcField f)
     {
         super(src);
          = src._annotated;
         if (f == null) {
             throw new IllegalArgumentException("No Field passed for property '"+src.getName()
                     +"' (class "+src.getDeclaringClass().getName()+")");
         }
          = f;
     }
     
     @Override
     public FieldProperty withName(String newName) {
         return new FieldProperty(thisnewName);
     }
     
     @Override
     public FieldProperty withValueDeserializer(JsonDeserializer<?> deser) {
         return new FieldProperty(thisdeser);
     }
     
     /*
     /**********************************************************
     /* BeanProperty impl
     /**********************************************************
      */
     
     @Override
     public <A extends Annotation> A getAnnotation(Class<A> acls) {
         return .getAnnotation(acls);
     }
 
     @Override public AnnotatedMember getMember() {  return ; }
 
     /*
     /**********************************************************
     /* Overridden methods
     /**********************************************************
     */
    @Override
    public void deserializeAndSet(JsonParser jp,
    		DeserializationContext ctxtObject instance)
        throws IOExceptionJsonProcessingException
    {
        set(instancedeserialize(jpctxt));
    }
    @Override
    		DeserializationContext ctxtObject instance)
        throws IOExceptionJsonProcessingException
    {
        return setAndReturn(instancedeserialize(jpctxt));
    }
    
    @Override
    public final void set(Object instanceObject value)
        throws IOException
    {
        try {
            .set(instancevalue);
        } catch (Exception e) {
            _throwAsIOE(evalue);
        }
    }
    @Override
    public Object setAndReturn(Object instanceObject value)
        throws IOException
    {
        try {
            .set(instancevalue);
        } catch (Exception e) {
            _throwAsIOE(evalue);
        }
        return instance;
    }
    /*
    /**********************************************************
    /* JDK serialization handling
    /**********************************************************
     */
    Object readResolve() {
        return new FieldProperty(this.getAnnotated());
    }
New to GrepCode? Check out our FAQ X