Jackson - Java bean to JSON string : uppercase variable converted into lowercase in JSON
<p>I am converting Java bean to JSON string using writeValueAsString method of ObjectMapper where uppercase variables from Java bean is being changed to lowercase in JSON string.
Jackson 2.7.4 version implemented.
Base bean sample -</p>

<pre><code>public class BaseBean {

private static final long serialVersionUID = 3947489072259877540L;

private int _iXId;
private String _sPNR;
private ArrayList _alMinPriced = new ArrayList&lt;TermBean&gt;();

public int getXId() {
    return _iXId;
}

public void setXId(int id) {
    _iXId = id;
}

public String getPNRNumber() {
    return _sPNR;
}

public void setPNRNumber(String _spnr) {
    _sPNR = _spnr;
}

public ArrayList getMinPriced() {
    return _alMinPriced;
}

public void setMinPriced(ArrayList minPriced) {
    _alMinPriced = minPriced;
}

public void setMinPriced(TermBean bnTerm) {
    _alMinPriced.add(bnTerm);
}
</code></pre>

<p>}</p>

<p>Earlier, we were using net.sf.json.JSON &amp; JSONSerializer for Java bean to JSON conversion. And generated JSON string was having similar naming as what we are having Java bean. Due to performance issue, I want to change this &amp; implement Jackson.</p>

<p>Restrictions : we can't change Java bean naming convention as these beans are from older project and there is little scope to change the variable names in bean and even adding json properties in each bean.</p>

<p>I have tried below code but that didn't worked</p>

<pre><code>ObjectMapper mapper = new ObjectMapper();
mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CAMEL_CASE);
</code></pre>

<p>Also, I have tried customized PropertyNamingStrategy but not clear on this.</p>

<p><strong>Edited :</strong></p>

<p><strong>net.sf.json.JSON</strong> generated JSON string as mentioned below for above bean :</p>

<pre><code>{"XId":11,"PNRNumber":"123456789","minPriced":[{"name":"JSON"},{"name":"simple"}]}
</code></pre>

<p><strong>Jackson</strong> generated JSON string as mentioned below for above bean :</p>

<pre><code>{"xid":11,"pnrnumber":"123456789","minPriced":[{"name":"JSON"},{"name":"Jackson"}]}
</code></pre>

<p>As you can see that "XId" converted to "xid" in jackson and "PNRNumber" converted to "pnrnumber" in jackson.</p>

<p>Is there any configuration changes available in Jackson to avoid such modification.
OR How to handle such scenario.</p>