11package com .github .developframework .kite .jackson ;
22
3- import com .fasterxml .jackson .databind .JsonNode ;
43import com .fasterxml .jackson .databind .ObjectMapper ;
54import com .fasterxml .jackson .databind .node .ObjectNode ;
65import com .fasterxml .jackson .databind .util .RawValue ;
1110import lombok .RequiredArgsConstructor ;
1211
1312import java .math .BigDecimal ;
13+ import java .math .BigInteger ;
1414
1515/**
1616 * 使用Jackson实现节点代理
@@ -41,8 +41,7 @@ public void putRaw(AssembleContext context, String name, String raw) {
4141 @ Override
4242 public void putPrototype (AssembleContext context , String name , Object prototype ) {
4343 final ObjectMapper objectMapper = (ObjectMapper ) context .configuration .getJsonFramework ().getCore ();
44- final JsonNode prototypeNode = objectMapper .valueToTree (prototype );
45- node .set (name , prototypeNode );
44+ node .set (name , objectMapper .valueToTree (prototype ));
4645 }
4746
4847 @ Override
@@ -62,6 +61,10 @@ public void putValue(String name, Object value, boolean xmlCDATA) {
6261 node .put (name , (Double ) value );
6362 } else if (valueClass == BigDecimal .class ) {
6463 node .put (name , (BigDecimal ) value );
64+ } else if (valueClass == BigInteger .class ) {
65+ node .put (name , (BigInteger ) value );
66+ } else if (valueClass == Short .class ) {
67+ node .put (name , (Short ) value );
6568 } else {
6669 node .put (name , value .toString ());
6770 }
0 commit comments