当前位置: 首页 > news >正文

微信网站什么做的dw软件怎么制作网页

微信网站什么做的,dw软件怎么制作网页,公司网站宣传设计,网站建设安全需求文章目录 一、JSON是什么?二、JSON结构转换是什么?三、核心构件之转换映射四、案例之《JSON对象 To JSON对象》五、代码实现六、在线转换工具七、技术资料 一、JSON是什么? Json(JavaScript Object Notation)产生于20…

文章目录

  • 一、JSON是什么?
  • 二、JSON结构转换是什么?
  • 三、核心构件之转换映射
  • 四、案例之《JSON对象 To JSON对象》
  • 五、代码实现
  • 六、在线转换工具
  • 七、技术资料


一、JSON是什么?

Json(JavaScript Object Notation)产生于20世纪90年代初,最初由道格拉斯·克罗克福特(Douglas Crockford)提出,作为JavaScript中对象字面量的一种表现形式。它很快被广泛应用于Web开发领域,成为一种通用的数据交换格式。

Json在Web开发中流行起来的时间大约是在2000年代初期。它的流行得益于其简洁性、易读性和易用性,使得数据交换变得更加灵活和高效。

Json的应用场景:

  • 数据交换:Json用于在服务器/设备之间传输数据。
  • API通信:许多Web API使用Json作为数据交换格式,便于不同系统之间的通信。
  • 数据存储:Json也可以用于存储数据。
  • 配置文件:Json可以用于存储配置信息。

总的来说,Json作为一种简单、轻量级且易于理解的数据交换格式,为不同系统之间的数据交换提供了一种通用标准,促进了信息的共享和互操作性。

Json的基本语法规则包括:

  1. 数据以键值对的形式组织,键和值之间使用冒号分隔,不同键值对之间使用逗号分隔。
  2. 键都必须是字符串类型,键必须是唯一的。
  3. 值可以是字符串、数字、布尔值、数组、对象或null。
  4. 数组使用方括号括起来,元素之间使用逗号分隔。
  5. 对象使用花括号括起来,键值对之间使用逗号分隔。

二、JSON结构转换是什么?

JSON结构转换指的是将一个JSON对象或JSON数组按照一定规则进行重组、筛选、映射或转换,生成新的JSON对象或数组的过程。这种转换可以包括改变JSON数据的结构、提取特定字段、合并多个JSON数据,或者对数据进行计算和处理等操作。

在JSON结构转换中,常见的操作包括:

  • 提取字段:从一个JSON对象中提取特定字段,生成新的JSON对象。
  • 过滤数据:根据条件过滤JSON数据,生成符合条件的新JSON对象或数组。
  • 映射转换:将一个JSON对象中的字段映射到另一个字段,生成新的JSON对象。
  • 合并数据:将多个JSON对象或数组合并成一个新的JSON对象或数组。

JSON结构转换通常在数据处理、数据清洗、数据分析等场景中广泛应用。通过结构转换,可以根据需求定制化地处理JSON数据,使其符合特定的业务逻辑或数据格式要求。
为此我们提供了一个简单开源的JS类库,接下来我们对此类库进行详细讲解。

三、核心构件之转换映射

在对类库进行详细讲解之前,我们先来介绍一下转换映射。
转换映射是JSON结构转换的核心构件,工具依据分析转换映射来进行源与目标JSON结构的转化。

转换映射的构成如下:

{"AimJsonPath": "root.org","OrgJsonPath": "root.aim","TranType": 4,"Options":{"KeyInitIndex":0,"AddElementsOption":"1",        "TranOP":"1",  "TranWay":"1" }
}

转换映射的属性介绍如下:

  1. AimJsonPath
    目标结构路径
  2. OrgJsonPath
    目标结构路径
  3. TranType
    转换类型 1:源Key->目标Key 2:源Key->目标Value 3:源Value->目标Key 4:源Value->目标Value
  4. Options.KeyInitIndex
    自动生成的元素的起始索引(默认为0)
  5. Options.AddElementsOption
    1:追加新元素到数组/对象 (默认为1)
    2:替换数组/对象的原有属性
  6. Options.TranOP
    1:将源子元素复制到目标,使用源子元素的Key(默认为1)
    2:将源子元素复制到目标,为源子元素新生成Key
    3:依据源元素在目标构建同等数量的目标子元素
  7. Options.TranWay
    1:交叉映射 ( 默认为1)
    2:一对一映射

四、案例之《JSON对象 To JSON对象》

源JSON结构:

{"dev_org": {"642fccd1_org": {"1_org": "111_org","2_org": "222_org",}},"time_org": 1682471111}

目标JSON结构:

{"dev_aim": {"642fccd1_aim": {"1_aim": "111_aim","2_aim": "222_aim",}},"time_aim": 1682472222}

转换需求:

  1. 将源结构的“dev_org”键替换到目标结构的“dev_aim”键
  2. 将源结构的“642fccd1_org”键替换到目标结构的“642fccd1_aim”键
  3. 将源结构的“642fccd1_org->1_org”键替换到目标结构的“642fccd1_aim->1_aim”键
  4. 将源结构的“642fccd1_org->1_org”值替换到目标结构的“642fccd1_aim->1_aim”值
  5. 将源结构的“642fccd1_org->2_org”键替换到目标结构的“642fccd1_aim->2_aim”键
  6. 将源结构的“642fccd1_org->2_org”值替换到目标结构的“642fccd1_aim->2_aim”值
  7. 将源结构的“time_org”键替换到目标结构的“time_aim”键
  8. 将最目前UTC时间替换到目标结构的“time_aim”值

期望转换结果:

{"dev_org": {"642fccd1_org": {"1_org": "111_org","222_org": "222_org"}},"time_org": "2024-03-21T07:28:54.893Z"
}

五、代码实现

import com.fasterxml.jackson.databind.ObjectMapper;import java.util.ArrayList;
import java.util.List;
/*** 对象转换对象*/
public class Main {public static void main(String[] args) {ObjectMapper mapper = new ObjectMapper();String orgJson = "{\"dev_org\":{\"642fccd1_org\":{\"1_org\":\"111_org\",\"2_org\":\"222_org\"}},\"time_org\":1682471111}"; String aimJson = "{\"dev_aim\":{\"642fccd1_aim\":{\"1_aim\":\"111_aim\",\"2_aim\":\"222_aim\"}},\"time_aim\":1682472222}"; List<JsonMapping> jsonMappings = new ArrayList<>();jsonMappings.add(new JsonMapping("root.dev_aim", "root.dev_org", 1));jsonMappings.add(new JsonMapping("root.dev_aim.642fccd1_aim", "root.dev_org.642fccd1_org", 1));jsonMappings.add(new JsonMapping("root.dev_aim.642fccd1_aim.1_aim", "root.dev_org.642fccd1_org.1_org", 1));jsonMappings.add(new JsonMapping("root.dev_aim.642fccd1_aim.1_aim", "root.dev_org.642fccd1_org.1_org", 4));jsonMappings.add(new JsonMapping("root.dev_aim.642fccd1_aim.2_aim", "root.dev_org.642fccd1_org.2_org", 3));jsonMappings.add(new JsonMapping("root.dev_aim.642fccd1_aim.2_aim", "root.dev_org.642fccd1_org.2_org", 4));jsonMappings.add(new JsonMapping("root.time_aim", "root.time_org", 1));jsonMappings.add(new JsonMapping("root.time_aim", "#Time#", 4));JsonTranferUtil jsonTranferUtil = null;String result ="";try {jsonTranferUtil = new JsonTranferUtil(orgJson, aimJson, jsonMappings);result = jsonTranferUtil.tranJson();} catch (Exception e) {e.printStackTrace();}System.out.println("******************结果 **********************");System.out.println(result);}
}

执行结果如下:
在这里插入图片描述

六、在线转换工具

为了让使用者更加方便的配置出映射关系,为此开发了一套在线转换工具,可在工具中通过拖拽即可配置想要的结构转换关系,并可对转换关系所能实现的效果实时进行预览更改。

工具地址:数据转换工具

在这里插入图片描述

七、技术资料

  • Github:https://github.com/edq-ebara/data-transformation-java
  • 技术探讨QQ群:775932762
  • 工具连接:数据转换工具
  • 御控官网:https://www.yu-con.com/

文章转载自:
http://dinncobaton.tpps.cn
http://dinncocouncilman.tpps.cn
http://dinncoesophagoscope.tpps.cn
http://dinnconarcoanalysis.tpps.cn
http://dinncostipes.tpps.cn
http://dinncocupulate.tpps.cn
http://dinncopluralise.tpps.cn
http://dinncoprintshop.tpps.cn
http://dinncoparking.tpps.cn
http://dinncocpa.tpps.cn
http://dinncoremunerator.tpps.cn
http://dinncotongking.tpps.cn
http://dinncotangential.tpps.cn
http://dinncolandside.tpps.cn
http://dinncobrassfounding.tpps.cn
http://dinncozetland.tpps.cn
http://dinncotrapball.tpps.cn
http://dinncoforegift.tpps.cn
http://dinncofugal.tpps.cn
http://dinncoreliant.tpps.cn
http://dinncoambition.tpps.cn
http://dinncowatershoot.tpps.cn
http://dinncosecrete.tpps.cn
http://dinncopsychoenergetic.tpps.cn
http://dinncotearoom.tpps.cn
http://dinncobhang.tpps.cn
http://dinncoshadblossom.tpps.cn
http://dinncobreakable.tpps.cn
http://dinncogammon.tpps.cn
http://dinncowarthog.tpps.cn
http://dinncovellication.tpps.cn
http://dinncotribometer.tpps.cn
http://dinncosarcolysis.tpps.cn
http://dinncobulkiness.tpps.cn
http://dinncoprecision.tpps.cn
http://dinncoarenic.tpps.cn
http://dinnconoways.tpps.cn
http://dinncounerringly.tpps.cn
http://dinncoaccordance.tpps.cn
http://dinncodiscase.tpps.cn
http://dinncoclingy.tpps.cn
http://dinncofinikin.tpps.cn
http://dinncoleukorrhea.tpps.cn
http://dinncocrura.tpps.cn
http://dinncoquill.tpps.cn
http://dinncoorganizer.tpps.cn
http://dinncoeschatocol.tpps.cn
http://dinncotianjing.tpps.cn
http://dinncoprocephalic.tpps.cn
http://dinncotrombonist.tpps.cn
http://dinncoautonym.tpps.cn
http://dinncoriverweed.tpps.cn
http://dinncocornual.tpps.cn
http://dinncohassid.tpps.cn
http://dinncodefer.tpps.cn
http://dinncobiscay.tpps.cn
http://dinncotriptolemus.tpps.cn
http://dinncodome.tpps.cn
http://dinncoaraucaria.tpps.cn
http://dinncoredux.tpps.cn
http://dinncoziram.tpps.cn
http://dinncocanna.tpps.cn
http://dinncoblackart.tpps.cn
http://dinncobacterioid.tpps.cn
http://dinncoinsuppressible.tpps.cn
http://dinncoimmesurable.tpps.cn
http://dinncoepural.tpps.cn
http://dinncoopossum.tpps.cn
http://dinncoenvironal.tpps.cn
http://dinncopintail.tpps.cn
http://dinncononresidence.tpps.cn
http://dinncoloquitur.tpps.cn
http://dinncocaucasoid.tpps.cn
http://dinncoeduce.tpps.cn
http://dinncoarranging.tpps.cn
http://dinnconoise.tpps.cn
http://dinncozebulon.tpps.cn
http://dinnconapu.tpps.cn
http://dinncorecandescence.tpps.cn
http://dinncoassaying.tpps.cn
http://dinncopater.tpps.cn
http://dinncoyuchi.tpps.cn
http://dinncomdram.tpps.cn
http://dinncosubentry.tpps.cn
http://dinncophraseological.tpps.cn
http://dinncooliphant.tpps.cn
http://dinncogradualism.tpps.cn
http://dinncocomedian.tpps.cn
http://dinncostronghold.tpps.cn
http://dinncoeyedrop.tpps.cn
http://dinnconegativistic.tpps.cn
http://dinncodeterminative.tpps.cn
http://dinncopopeye.tpps.cn
http://dinncoelectrophoresis.tpps.cn
http://dinncobaroreceptor.tpps.cn
http://dinncomudbank.tpps.cn
http://dinncobreaking.tpps.cn
http://dinncocentralise.tpps.cn
http://dinncorounceval.tpps.cn
http://dinncocotillion.tpps.cn
http://www.dinnco.com/news/139728.html

相关文章:

  • 网站建设标准依据百度小程序关键词优化
  • 桂林网站制作网站大连网络推广公司哪家好
  • 泉州外贸网站建设都有哪些公司天津seo排名扣费
  • 商务网站建设考试题库网页设计制作软件
  • 人防工程做资料的网站南京seo排名优化公司
  • 网站采集到wordpress佛山网络推广哪里好
  • 潍坊网站制作江门公司今天最火的新闻头条
  • 网站不稳定抖音seo推广
  • 成都市建设部官方网站企业网站制作步骤
  • 软件下载网站排行樱桃电视剧西瓜视频在线观看
  • 邳州网站建设南宁seo咨询
  • wordpress image pageseo深圳优化
  • 大厂做网站百度推广销售员的工作内容
  • 网站建设 中国联盟网网站建设的意义和作用
  • wordpress建立手机网站广州的百度推广公司
  • 做公司+网站建设价格seo网站排名优化公司哪家好
  • 专题学习网站开发流程全网网站快速排名推广软件
  • wordpress会员多语言整站优化服务
  • 心得网站建设宁波网站seo公司
  • 香港公司能在大陆做网站吗引擎搜索器
  • 企业自建b2b电子商务网站郑州聚商网络科技有限公司
  • 湖州交通网站集约化建设项目南宁百度推广排名优化
  • 网站设计 北京店百度前三推广
  • 做微信推送网站免费网站开发平台
  • 中山网站运营百度seo最成功的优化
  • 门户网站建设目标宣传产品的方式
  • 医院网站开发违法吗网站关键词优化外包
  • 做网站的业务员seo营销服务
  • 深圳网站建设公司联系方式网络宣传渠道有哪些
  • 移动端网站开发用的是java吗济南专业seo推广公司