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

有哪些专门做写字楼的网站wordpress便签

有哪些专门做写字楼的网站,wordpress便签,网站建设与推广实训小结,建立网站需要多少钱 纠正错误湖南岚鸿moxy json介绍我们正在向EclipseLink MOXy添加从域模型生成JSON模式的 功能 。 为此#xff0c;我们创建了一个新的变量节点映射。 在本文中#xff0c;我将通过将Java模型映射到JSON模式来演示新的映射。 您可以使用每晚构建的EclipseLink 2.6.0进行尝试#xff1a; http… moxy json介绍 我们正在向EclipseLink MOXy添加从域模型生成JSON模式的 功能 。 为此我们创建了一个新的变量节点映射。 在本文中我将通过将Java模型映射到JSON模式来演示新的映射。 您可以使用每晚构建的EclipseLink 2.6.0进行尝试 http://www.eclipse.org/eclipselink/downloads/nightly.php JSON模式input.json / Output 以下是摘自http://json-schema.org/examples.html的“基本示例”。 请注意该类型具有许多属性但它们不会显示为JSON数组。 相反它们显示为键入在属性名称上的单独的JSON对象。 {title: Example Schema,type: object,properties: {firstName: {type: string},lastName: {type: string},age: {description: Age in years,type: integer,minimum: 0}},required: [firstName, lastName] }Java模型 以下是我们用于此示例的Java模型。 JsonSchema存储在列表中的属性 在JSON模式的Java表示中我们有一个类它具有Property对象的集合。 而不是集合的默认表示形式请参阅 绑定到JSONXML –处理集合 我们希望每个Property以其名称作为键。 我们可以使用XmlVariableNode批注进行此操作。 通过它我们可以指定目标对象的字段/属性该字段/属性应用作键。 package blog.variablenode.jsonschema;import java.util.*; import javax.xml.bind.annotation.*; import org.eclipse.persistence.oxm.annotations.XmlVariableNode;XmlAccessorType(XmlAccessType.FIELD) public class JsonSchema {private String title;private String type;XmlElementWrapperXmlVariableNode(name)public ListProperty properties;private ListString required;} JsonSchema存储在地图中的属性 在此版本的JsonSchema类中我们将属性的类型从List Property属性更改为Map StringProperty 。 注释保持不变所不同的是当XmlVariableNode是在地图中使用的变量节点名称作为地图的关键。 package blog.variablenode.jsonschema;import java.util.*; import javax.xml.bind.annotation.*; import org.eclipse.persistence.oxm.annotations.XmlVariableNode;XmlAccessorType(XmlAccessType.FIELD) public class JsonSchema {private String title;private String type;XmlElementWrapperXmlVariableNode(name)public MapString, Property properties;private ListString required;} 属性 为了防止将名称字段编组我们需要使用XmlTransient对其进行注释请参见JAXB和Unmapped属性 。 package blog.variablenode.jsonschema;import javax.xml.bind.annotation.*;XmlAccessorType(XmlAccessType.FIELD) public class Property {XmlTransientprivate String name;private String description;private String type;private Integer minimum;}示范代码 下面是一些示例代码您可以用来证明一切正常。 package blog.variablenode.jsonschema;import java.util.*; import javax.xml.bind.*; import javax.xml.transform.stream.StreamSource; import org.eclipse.persistence.jaxb.JAXBContextProperties;public class Demo {public static void main(String[] args) throws Exception {MapString, Object properties new HashMapString, Object();properties.put(JAXBContextProperties.MEDIA_TYPE, application/json);properties.put(JAXBContextProperties.JSON_INCLUDE_ROOT, false);JAXBContext jc JAXBContext.newInstance(new Class[] {JsonSchema.class}, properties);Unmarshaller unmarshaller jc.createUnmarshaller();StreamSource json new StreamSource(src/blog/variablenode/jsonschema/input.json);JsonSchema jsonSchema unmarshaller.unmarshal(json, JsonSchema.class).getValue();Marshaller marshaller jc.createMarshaller();marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);marshaller.marshal(jsonSchema, System.out);}}外部元数据 MOXy还提供了一个外部映射文档使您可以为第三方对象提供元数据或为模型应用替代映射请参阅将对象映射到多个XML模式–天气示例 。 以下是此示例的映射文档。 ?xml version1.0? xml-bindingsxmlnshttp://www.eclipse.org/eclipselink/xsds/persistence/oxmpackage-nameblog.variablenode.jsonschemaxml-accessor-typeFIELDjava-typesjava-type nameJsonSchemajava-attributesxml-variable-node java-attributeproperties java-variable-attributenamexml-element-wrapper//xml-variable-node/java-attributes/java-typejava-type namePropertyjava-attributesxml-transient java-attributename//java-attributes/java-type/java-types /xml-bindings 参考 来自MOXy的XmlVariableNode –来自我们的JCG合作伙伴 Blaise Doughan的JSON模式示例 位于Java XMLJSON Binding博客上。 翻译自: https://www.javacodegeeks.com/2013/06/moxys-xmlvariablenode-json-schema-example.htmlmoxy json介绍
http://www.sadfv.cn/news/105095/

相关文章:

  • wordpress全站迁移建网站选服务器
  • 一个空间放2个网站Wordpress 图片左右滑动
  • 晓风彩票网站建设软件找方案的网站
  • 做视频有赚钱的网站长沙做网站建设的
  • 属于网站建设过程规划网页游戏大全排行榜
  • 北京网站建设公司联系方式wordpress可以用织梦模板吗
  • 如何检测网站被搜索引擎惩罚了天津网上办事大厅
  • 网站开发怎么连接sqlserver做网站费用多少
  • 浙江建设工程考试网站北京楼市暴跌
  • 工业设计产品分析案例hyein seo
  • 成都网站设计哪家好嘉定企业网站建设
  • 网站维护和网页维护区别福田欧辉广东工厂
  • 珠海网站建设成功案例优化公司网站排名
  • 略阳县有关作风建设的网站最好看免费观看高清大全
  • 网站建设云尚网络dedecms网站搬家
  • 企业发展历程网站国家企业信息官网查询
  • 众希网站建设企业如何申请网站
  • 购买腾讯云 做网站网站开发流程及顺序
  • 网站建设是自己做好还是外包wordpress 酷炫分页
  • 在百度上做网站怎么做如何做博客网站
  • 简述商务网站建设步骤wordpress升级主机名是啥
  • 网站建设中常见的问题建筑网站网页设计
  • 青岛建设网站设计公司扬中网站建设要多少钱
  • 网站loading动画效果wordpress文章分享插件
  • 在县城做同城网站怎么样广西梧州市住房和城乡建设局网站
  • wordpress单页网站在本页跳转国内外基于vue框架的网站建设现状
  • 建设交易平台网站多少钱碧桂园事件全过程
  • 哪里建设网站好免费的wordpress主机
  • wordpress导航站龙岗网站建设公司怎么样
  • 免费网站ppt模板下载做网站有什么建议