开发者

how to generate JMX MXBean compatible java class model from JAXB?

开发者 https://www.devze.com 2023-01-03 06:59 出处:网络
From the JMX MXBean specification, a java class type J must satisfy Either if J has at least one public constructor with a ConstructorP开发者_如何学Pythonroperties annotation,

From the JMX MXBean specification, a java class type J must satisfy

Either if J has at least one public constructor with a ConstructorP开发者_如何学Pythonroperties annotation, Or if J has a public no-arg constructor, and for every getter in J with type T and name N there is a corresponding setter with the same name and type

So how can I use JAXB to generate JAVA class model which satisfy the MXBean constrain?

Thanks YU


JAXB satisfies the getter/setter constraint, doesn't it? Or, rather xjc satisfies it. JAXB itself is just the framework. xjc is used to generate Java code from an XML schema definition file.

As for the annotation: This doesn't seem to be necessary. JAXB always needs a no-arg constructor for unmarshalling.

If this doesn't sound right to you, maybe you could clarify your question (with a small example if appropriate).

0

精彩评论

暂无评论...
验证码 换一张
取 消