net.java.dev.webdav.jaxrs.xml
Class WebDavContextResolver
java.lang.Object
net.java.dev.webdav.jaxrs.xml.WebDavContextResolver
- All Implemented Interfaces:
- javax.ws.rs.ext.ContextResolver<javax.xml.bind.JAXBContext>
@Provider
public final class WebDavContextResolver
- extends java.lang.Object
- implements javax.ws.rs.ext.ContextResolver<javax.xml.bind.JAXBContext>
Provides support for custom extensions to WebDAV, like custom Properties and XML Elements.
WebDAV allows custom extensions for XML Elements and Properties. To enable JAX-RS to deal with these, each of them must be implemented as a JAXB class and registered by passing it to the constructor of this resolver.
- Author:
- Markus KARG (mkarg@users.dev.java.net)
- See Also:
- Chapter 17 "XML Extensibility in DAV" of RFC 2616 "Hypertext Transfer Protocol -- HTTP/1.1"
|
Constructor Summary |
WebDavContextResolver(java.lang.Class<?>... additionalClasses)
Creates an instance of this resolver, registering the provided custom XML
Elements and Properties. |
|
Method Summary |
javax.xml.bind.JAXBContext |
getContext(java.lang.Class<?> cls)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebDavContextResolver
public WebDavContextResolver(java.lang.Class<?>... additionalClasses)
throws javax.xml.bind.JAXBException
- Creates an instance of this resolver, registering the provided custom XML
Elements and Properties.
- Parameters:
additionalClasses - The custom extensions (JAXB classes) to be registered (can be
left blank).
- Throws:
javax.xml.bind.JAXBException - if an error was encountered while creating the JAXBContext,
such as (but not limited to): No JAXB implementation was
discovered, Classes use JAXB annotations incorrectly, Classes
have colliding annotations (i.e., two classes with the same
type name), The JAXB implementation was unable to locate
provider-specific out-of-band information (such as additional
files generated at the development time.)
getContext
public final javax.xml.bind.JAXBContext getContext(java.lang.Class<?> cls)
- Specified by:
getContext in interface javax.ws.rs.ext.ContextResolver<javax.xml.bind.JAXBContext>
- Returns:
- A single, shared context for both, WebDAV XML Elements and
Properties and custom extensions.
Copyright © 2008-2009 The java.net WebDAV Project. All Rights Reserved.