Hi
Tim!
It is
certainly possible to store the metadata anywhere you want - the
TypeDesc.getTypeDescForClass() method is the control point there. Right
now we look for a) inline static metdata, and b) a "Helper" class which contains
the metadata. This could easily be extended to include scanning
for an XML or a properties file.
The
TypeDesc class contains XML <-> Java databinding information in a
well-structured form. The BeanInfo class just gives you name/value pairs,
so we'd still need to come up with some kind of data structure to store the
actual information about mapping fields/properties to XML elements/attributes
even if we got that data from BeanInfo classes. We've discussed getting
the TypeDesc from a BeanInfo structure, but haven't gone there
yet.
In
terms of publishing existing beans without modifying them, this works fine in
that a) the default serialization will apply to beans with no metadata (all
public fields represented as XML elements, and I think the schema uses
<all>) and b) we support external metadata in the form of a Helper
class right now, and may support other file-based formats in the
future.
TypeDesc/FieldDesc should expand to handle capturing more of what schema
can do (all/sequence/choice/etc), and we also hope to include a constraint
system at some point to support schema restriction types with limited value
sets.
As for
"Axis-specific", any XML<->Java databinding framework (JAXB, Castor, Axis)
is going to be proprietary right now, in that the metadata gets read by some
tool that is deserializing or serializing XML in some custom way. It may
be that this stuff gets standardized (that's where JAXB is trying to go, for
instance), but we're not there yet. Until a standard we like better
arrives, we're going to try to make Axis do this as efficiently and simply as we
can. It's also the plan at some point to tease the databinding framework
away from the rest of Axis so that it can be used independently from, as well as
in concert with, the SOAP/Handler stuff.
--Glen
|
- JavaBeans and metadata Tim Blake
- Glen Daniels