Currently, default rules imply that for each XML element a Java object will be created.
For user-defined XML types that are not bound with annotations, the default algorithm will be used to derive a fully-qualified class name from the XML type/element QName.
If the class cannot be loaded, a warning will be logged and this element and all its attributes, text and child elements will be ignored. Or, if ignoreNotFoundFieldOrClass property is false (default is true), an unchecked exception will be thrown halting unmarshalling immediately.
If for an element of a complex type a user doesn't want to create an object but wants to set its attributes, text and child elements on the object created for the parent element, jbxb:skip should be placed on the element.
"sco...@jb..." wrote : The text of the value element maps to the "text" property of the JNDIBinding class.
This is not how it works.
jbxb:property binds the result of unmarshalling of an element to a property.
If element is of a simple type, the result is unmarshalled text content. If element is of a complex type, the result is an object that contains unmarshalled attrs, text and child elements. You have to nest jbxb:property in jbxb:characters to bind text content to a specific property.
In your case, you there is no object specific to the value element. And still, I think, it's better to nest jbxb:property in jbxb:characters in this case for consistency. Otherwise, it looks confusing to me.
"sco...@jb..." wrote : In terms of the default behavior, the question is whether or not it makes sense for the jbxb:skip to be implicitly present for any element that does not have an explicit or automatic class specification?
There could be a case, in which I would like to ignore the whole branch of XML elements and their contents. In this case, it's not jbxb:skip.
I don't know which case is going to be more common. I would stick to the current behaviour for now. If your opinion is different, let's discuss.
"sco...@jb..." wrote : This could be another jbxb:schemaBindings setting.
Yes. Then we will also need a jbxb:ignore or something like that to switch the behaviour that is currently the default.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3885872#3885872
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3885872
|