我有一个jsonurl
,我想读,它看起来像这样:如何为gatling json编写自定义进纸器?
> {
> "elements": [
> {
> "box": {
> "x": 0,
> "y": 0,
> "width": 186,
> "height": 10.526316
> },
> "type": "Header"
> },
> {
> "box": {
> "x": 0,
> "y": 0,
> "width": 0,
> "height": 0
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 0,
> "y": 14.035088,
> "width": 43.333332,
> "height": 3.508772
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 95.08772,
> "y": 14.035088,
> "width": 90.87719,
> "height": 45.614037
> },
> "type": "Image"
> },
> {
> "box": {
> "x": 95.08772,
> "y": 63.157894,
> "width": 90.87719,
> "height": 3.508772
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 95.08772,
> "y": 63.157894,
> "width": 90.87719,
> "height": 3.508772
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 47.54386,
> "y": 42.105263,
> "width": 43.333332,
> "height": 5.9649124
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 0,
> "y": 0,
> "width": 43.333332,
> "height": 98.24561
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 47.54386,
> "y": 0,
> "width": 43.333332,
> "height": 98.24561
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 95.08772,
> "y": 0,
> "width": 43.333332,
> "height": 98.24561
> },
> "type": "Regular"
> },
> {
> "box": {
> "x": 142.63158,
> "y": 0,
> "width": 43.333332,
> "height": 98.24561
> },
> "type": "Regular"
> }
> ],
> "points": [
> {
> "x": 190,
> "y": 22.192982
> },
> {
> "x": 376,
> "y": 22.192982
> },
> {
> "x": 376,
> "y": 120.4386
> },
> {
> "x": 190,
> "y": 120.4386
> }
> ],
> "state": "UNUSED",
> "contentPath": "/content/ffx/print-authoring/en/newsholes/FNZ/DPT/2016/05/30/test_pages/q001/newshole-63019301",
> "assetId": null },
然后我想读的"state"
和"contentPath"
和映射。 目前我使用的是静态源,如:
VAL nhfeeder = jsonFile( “形状-data.json”)
使用如,
.feed(nhfeeder)
这是一个静态的源,所以我想要一个自定义的进纸器,可以直接从jsonurl
读取,并做需要。
这不是一个非常有用的答案,也是通用的,除了重点 – VeRo