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).
精彩评论