title: How to access default jackson serialization in a custom serializer
body: <p>I want to create a custom serializer which does a tiny bit of work and then leaves the rest for default serialization. </p>
  
  <p>For example:</p>
  
  <pre><code>@JsonSerialize(using = MyClassSerializer.class)
  public class MyClass {
    ...
  }
  
  public class MyClassSerializer extends JsonSerializer&lt;MyClass&gt; {
      @Override
      public void serialize(MyClass myClass, JsonGenerator generator, 
                            SerializerProvider provider) 
              throws JsonGenerationException, IOException {
          if (myClass.getSomeProperty() == someCalculationResult) {
              provider.setAttribute("special", true);
          }
          generator.writeObject(myClass);
      }  
  }
  </code></pre>
  
  <p>With the idea of creating other custom serializers for aggregated objects which behave differently based on the 'special' attribute value.  However, the above code does not work, as it unsurprisingly goes into an infinite recursion.</p>
  
  <p>Is there a way to tell jackson to use default serialization once I have set the attribute?  I don't really want enumerate all the properties like many custom serializers as the class is fairly complex and I don't want to have to do dual maintenance with the serializer every time I change the class.</p>