简体   繁体   English

在XSD中使用现有的Java类作为类型

[英]Using an existing Java class as a type in XSD

Is it possible to defines a type in xsd that uses an existing Java class as an extension base ? 是否可以在xsd中定义一个使用现有Java类作为扩展库的类型?

My base class has a few functions that have business logic in them. 我的基类有一些包含业务逻辑的函数。 I would like my auto-generated beans to also have those functions. 我希望我的自动生成的bean也具有这些功能。 The only way I can think of is to have the types in my XSD extend this base class. 我能想到的唯一方法是让XSD中的类型扩展此基类。

Is this even possible ? 这有可能吗?

您可以使用JAXB2 Basics继承插件来实现此目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM