2014-07-03 57 views
0

正如我的文檔中寫着:忽略傑克遜I/O串行化領域,也忽視了未知領域

// (i.e. not include in JSON output; or being set even if they were included) 
\@JsonIgnoreProperties({ "internalId", "secretKey" }) 
// To ignore any unknown properties in JSON input without exception: 
\@JsonIgnoreProperties(ignoreUnknown=true) 

,但我怎麼能則會忽略這兩個未知的,給予

+0

我不是專家,但也許只是添加兩個註釋,或者你可以只添加一個? –

+0

我只能添加一個註釋 –

+0

JamesB Eclipse不要抱怨,我認爲它可以工作 –

回答

2

假設我正確理解你,你可以結合你想要的條件到相同的註釋:

@JsonIgnoreProperties(value = { "internalId", "secretKey" }, ignoreUnknown = true)