You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mark <ma...@gmail.com> on 2009/07/15 17:10:49 UTC

Lookup QName for Class

Is there an easy way for the client developer to lookup the QName that will
be used for serialization of a given class?
I'm sure it is necessary deep within the serialization to do this.
However, is there a simple way at an outer most level for someone to lookup
the QName?

The use case is an easy way to pass in a QName representing the type of a
class to an web service operation that resolves the type based on QName.

Re: Lookup QName for Class

Posted by Daniel Kulp <dk...@apache.org>.
There isn't really a "public" way to do this.   However, if you create a 
JAXBContext and cast it to the Sun internal JAXBContext subclass, there are 
methods on it for these things.  

QName JAXBRIContext.getElementName(Object o);
JaxBeanInfo<T> getBeanInfo(Class<T> clazz);
JaxBeanInfo getGlobalType(QName name) 
Set<QName> getValidRootNames() {
etc...

Dan




On Wed July 15 2009 11:10:49 am Mark wrote:
> Is there an easy way for the client developer to lookup the QName that will
> be used for serialization of a given class?
> I'm sure it is necessary deep within the serialization to do this.
> However, is there a simple way at an outer most level for someone to lookup
> the QName?
>
> The use case is an easy way to pass in a QName representing the type of a
> class to an web service operation that resolves the type based on QName.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog