title: Jackson - chaining of @JsonValue and Map
body: <p>I have the following class:</p>
  
  <pre><code>public class SomeKey {
      private final String name;
  
      @JsonValue
      public String getName() {
          return name;
      }
  
      @JsonCreator
      public SomeKey(final String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>I have the following container:</p>
  
  <pre><code>public class Container {
      @JsonSerialize
      private final Map&lt;SomeKey, Object&gt; data;
  }
  </code></pre>
  
  <p>In this case, the function <code>SomeKey.getName()</code> is used to serialize the key of the maps, as expected. However, if I change the Container as following, the function <code>SomeKey.toString()</code> is used:</p>
  
  <pre><code>public class Container {
      private final Map&lt;SomeKey, Object&gt; data;
  
      @JsonValue
      public Map&lt;SomeKey, Object&gt; data() {
          return data;
      }
  }
  </code></pre>
  
  <p>In other words, the <code>@JsonValue</code> on <code>SomeKey</code> is ignored. As far as I can tell, there seems to be some problem with chaining <code>@JsonValue</code> annotations. Is this a bug or am I doing something wrong here?</p>
  
  <p>Jackson version: 2.6.2</p>