Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.jackson.databind.ser.impl;
  
  
 
     extends BeanSerializerBase
 {
    
Transformer used to add prefix and/or suffix for properties of unwrapped POJO.
 
     protected final NameTransformer _nameTransformer;
     
     /*
     /**********************************************************
     /* Life-cycle: constructors
     /**********************************************************
      */

    
Constructor used for creating unwrapping instance of a standard BeanSerializer
 
     public UnwrappingBeanSerializer(BeanSerializerBase srcNameTransformer transformer) {
         super(srctransformer);
          = transformer;
     }
 
     public UnwrappingBeanSerializer(UnwrappingBeanSerializer srcObjectIdWriter objectIdWriter) {    
         super(srcobjectIdWriter);
          = src._nameTransformer;
     }
 
     protected UnwrappingBeanSerializer(UnwrappingBeanSerializer srcString[] toIgnore) {
         super(srctoIgnore);
          = src._nameTransformer;
     }
     
     /*
     /**********************************************************
     /* Life-cycle: factory methods, fluent factories
     /**********************************************************
      */
 
     @Override
     public JsonSerializer<ObjectunwrappingSerializer(NameTransformer transformer) {
         // !!! 23-Jan-2012, tatu: Should we chain transformers?
         return new UnwrappingBeanSerializer(thistransformer);
     }
 
     @Override
     public boolean isUnwrappingSerializer() {
         return true// sure is
     }
 
     @Override
     public UnwrappingBeanSerializer withObjectIdWriter(ObjectIdWriter objectIdWriter) {
         return new UnwrappingBeanSerializer(thisobjectIdWriter);
     }
 
     @Override
     protected UnwrappingBeanSerializer withIgnorals(String[] toIgnore) {
         return new UnwrappingBeanSerializer(thistoIgnore);
     }

    
JSON Array output can not be done if unwrapping operation is requested; so implementation will simply return 'this'.
 
     @Override
     protected BeanSerializerBase asArraySerializer() {
         return this;
     }
     
     /*
     /**********************************************************
     /* JsonSerializer implementation that differs between impls
     /**********************************************************
      */

    
Main serialization method that will delegate actual output to configured com.fasterxml.jackson.databind.ser.BeanPropertyWriter instances.
 
     @Override
     public final void serialize(Object beanJsonGenerator jgenSerializerProvider provider)
         throws IOExceptionJsonGenerationException
     {
         if ( != null) {
             _serializeWithObjectId(beanjgenproviderfalse);
             return;
         }
        if ( != null) {
            serializeFieldsFiltered(beanjgenprovider);
        } else {
            serializeFields(beanjgenprovider);
        }
    }
    
    /*
    /**********************************************************
    /* Standard methods
    /**********************************************************
     */
    @Override public String toString() {
        return "UnwrappingBeanSerializer for "+handledType().getName();
    }
New to GrepCode? Check out our FAQ X