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 using regular "setter" method.
 
 public final class MethodProperty
     extends SettableBeanProperty
 {
     private static final long serialVersionUID = 1;
 
     protected final AnnotatedMethod _annotated;
    
    
Setter method for modifying property value; used for "regular" method-accessible properties.
 
     protected final transient Method _setter;
     
     public MethodProperty(BeanPropertyDefinition propDef,
             JavaType typeTypeDeserializer typeDeser,
             Annotations contextAnnotationsAnnotatedMethod method)
     {
         super(propDeftypetypeDesercontextAnnotations);
          = method;
          = method.getAnnotated();
     }
 
     protected MethodProperty(MethodProperty srcJsonDeserializer<?> deser) {
         super(srcdeser);
          = src._annotated;
          = src._setter;
     }
 
     protected MethodProperty(MethodProperty srcString newName) {
         super(srcnewName);
          = src._annotated;
          = src._setter;
     }

    
Constructor used for JDK Serialization when reading persisted object
 
     protected MethodProperty(MethodProperty srcMethod m) {
         super(src);
          = src._annotated;
          = m;
     }
     
     @Override
     public MethodProperty withName(String newName) {
         return new MethodProperty(thisnewName);
     }
     
     @Override
         return new MethodProperty(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 jpDeserializationContext ctxt,
             Object 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 {
            .invoke(instancevalue);
        } catch (Exception e) {
            _throwAsIOE(evalue);
        }
    }
    @Override
    public Object setAndReturn(Object instanceObject value)
    {
        try {
            Object result = .invoke(instancevalue);
            return (result == null) ? instance : result;
        } catch (Exception e) {
            _throwAsIOE(evalue);
            return null;
        }
    }
    /*
    /**********************************************************
    /* JDK serialization handling
    /**********************************************************
     */
    Object readResolve() {
        return new MethodProperty(this.getAnnotated());
    }
New to GrepCode? Check out our FAQ X