public BaseDataJsonFieldBo setDataAttr ( String dPath , Object value ) { if ( value == null ) { return removeDataAttr ( dPath ) ; } Lock lock = lockForWrite ( ) ; try { if ( dataJson == null || dataJson instanceof MissingNode || dataJson instanceof NullNode ) { // initialize the "data" String [ ] paths = DPathUtils . splitDpath ( dPath ) ; if ( paths [ 0 ] . matches ( "^\\[(.*?)\\]$" ) ) { dataJson = JsonNodeFactory . instance . arrayNode ( ) ; } else { dataJson = JsonNodeFactory . instance . objectNode ( ) ; } } JacksonUtils . setValue ( dataJson , dPath , value , true ) ; return ( BaseDataJsonFieldBo ) setAttribute ( ATTR_DATA , SerializationUtils . toJsonString ( dataJson ) , false ) ; } finally { lock . unlock ( ) ; } }
Set a data s sub - attribute using d - path .