How to convert not all attributes from a java object to json using jackson object mapper
<p>I'm searching for a way to convert just a partial object (not all attrbiutes of it) via jackson to json. At the moment I'm using this solution:</p>

<pre><code>User userServed = User.find.byId(id);
ObjectMapper mapper = new ObjectMapper();
JsonNode node = null;
node = mapper.convertValue(userServed, JsonNode.class);
</code></pre>

<p>It works fine so far.</p>

<p>My Problem is that I have a lot of attributes in the Object I don't want to expose to the json node like lists. Is there a way maybe to select just the needed attributes?</p>