Java JSON在值中返回插入符号(^),在响应中返回null

Java JSON在值中返回插入符号(^),在响应中返回null,java,json,serialization,kibana,getter-setter,Java,Json,Serialization,Kibana,Getter Setter,我正在用kibana映射json值,一个元素,即它返回的量以“^”开头,而不是映射getter和setter。我如何映射它呢?我也使用了@jsonProperty和@jsonCreator,但仍然在值中看到null 例如: { "value": "530b8371", "Code": "AH", "^amount": "$275,817.49", "d

我正在用kibana映射json值,一个元素,即它返回的量以“^”开头,而不是映射getter和setter。我如何映射它呢?我也使用了@jsonProperty和@jsonCreator,但仍然在值中看到null

例如:

{
  "value": "530b8371",
  "Code": "AH",
  "^amount": "$275,817.49",
  "description": "grant"
}
这不是(必要的)答案,但需要显示代码

无法重现问题中提出的问题

以下使用
@JsonProperty
的Jackson映射代码工作正常

下面使用的导入

import com.fasterxml.jackson.annotation.JsonCreator;
导入com.fasterxml.jackson.annotation.JsonProperty;
导入com.fasterxml.jackson.databind.ObjectMapper;
选项1:对字段使用
@JsonProperty

class-Foo{
@JsonProperty
私有字符串值;
@JsonProperty(“代码”)
私有字符串码;
@JsonProperty(“^amount”)
私有字符串数量;
@JsonProperty
私有字符串描述;
@凌驾
公共字符串toString(){
返回“Foo[value=“+this.value+”,code=“+this.code+
“,amount=“+this.amount+”,description=“+this.description+””;
}
}
选项2:在方法上使用
@JsonProperty

class-Foo{
私有字符串值;
私有字符串码;
私有字符串数量;
私有字符串描述;
@JsonProperty
公共字符串getValue(){
返回此.value;
}
公共void设置值(字符串值){
这个值=值;
}
@JsonProperty(“代码”)
公共字符串getCode(){
返回此.code;
}
公共无效设置码(字符串码){
this.code=代码;
}
@JsonProperty(“^amount”)
公共字符串getAmount(){
退还此金额;
}
公共作废设置金额(字符串金额){
这个。金额=金额;
}
@JsonProperty
公共字符串getDescription(){
返回此.description;
}
公共void集合描述(字符串描述){
this.description=描述;
}
@凌驾
公共字符串toString(){
返回“Foo[value=“+this.value+”,code=“+this.code+
“,amount=“+this.amount+”,description=“+this.description+””;
}
}
选项3:在构造函数上使用
@JsonCreator

class-Foo{
私有字符串值;
私有字符串码;
私有字符串数量;
私有字符串描述;
@JsonCreator
public Foo(@JsonProperty(“value”)字符串值,
@JsonProperty(“代码”)字符串代码,
@JsonProperty(“^amount”)字符串金额,
@JsonProperty(“描述”)字符串描述){
这个值=值;
this.code=代码;
这个。金额=金额;
this.description=描述;
}
@凌驾
公共字符串toString(){
返回“Foo[value=“+this.value+”,code=“+this.code+
“,amount=“+this.amount+”,description=“+this.description+””;
}
}
试验

String json=“{\r\n”+
“\”值\“:\”530b8371\”,\r\n“+
“\”代码\“:\”啊\“,\r\n”+
“^amount”:“$275817.49”,\r\n”+
“\”说明\“:\”授权\“\r\n”+
"}";
ObjectMapper ObjectMapper=新的ObjectMapper();
Foo-Foo=objectMapper.readValue(json,Foo.class);
系统输出打印项次(foo);
输出(以上所有
Foo
类相同)

Foo[value=530b8371,code=AH,amount=275817.49美元,description=grant]

您是否尝试过
@JsonProperty(“^amount”)
?@是的,我在setter和getter方法上尝试过。