gpt4 book ai didi

java - JAXB:默认情况下哪些元素是可编码|不可编码的?

转载 作者:行者123 更新时间:2023-11-30 09:48:52 25 4
gpt4 key购买 nike

知道这是在某处指定的,但就是找不到。

JAXB api 文档或规范中的某处必须有关于类必须满足哪些属性的信息,以便 JAXB 可以编码|取消编码它而无需 JAXB 类型适配器。

这是关于 toString()List 接口(interface)、某些 ctor 签名必须适合等等的事情......

请指出一个位置。

最佳答案

JAXB 2.2 规范 (JSR-222) 的第 5.4.1 节讨论了创建要求:

Creation

  • A value class supports creation via a public constructor, either an explicit one or the default no-arg constructor.
  • A factory method in the package’s ObjectFactory class (introduced in Section 5.2, “Java Package”). The factory method returns the type of the Java value class. The name of the factory method is generated by concatenating the following components:
    • The string constant create.
    • If the Java value class is nested within another value class, then the concatenation of all outer Java class names.
    • The name of the Java value class. For example, a Java value class named Foo that is nested within Java value class Bar would have the following factory method signature generated in the containing Java package’s ObjectFactory class: Bar.Foo createBarFoo() {...}

第 5.5 节介绍属性

其他

  • JAXB 规范中没有关于toString() 的内容。

关于java - JAXB:默认情况下哪些元素是可编码|不可编码的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6061603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com