org.apache.wink.webdav.server
Class WebDAVResponseBuilder.PropertyHandler

java.lang.Object
  extended by org.apache.wink.webdav.server.WebDAVResponseBuilder.PropertyHandler
Direct Known Subclasses:
WebDAVResponseBuilder.CollectionPropertyHandler
Enclosing class:
WebDAVResponseBuilder

public static class WebDAVResponseBuilder.PropertyHandler
extends java.lang.Object

Used during the creation of a WebDAV multistatus response to get the properties and their values. Applications may override any of the methods as required.


Constructor Summary
WebDAVResponseBuilder.PropertyHandler()
           
 
Method Summary
 void setAllPropertyNames(WebDAVResponseBuilder builder, Prop prop, SyndBase synd)
          Set the Prop instance with empty (no values) properties.
 void setPropertyValue(WebDAVResponseBuilder builder, Response response, java.lang.Object property, SyndBase synd)
          Set the value of a provided property, and set the property on the response object with the correct status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDAVResponseBuilder.PropertyHandler

public WebDAVResponseBuilder.PropertyHandler()
Method Detail

setAllPropertyNames

public void setAllPropertyNames(WebDAVResponseBuilder builder,
                                Prop prop,
                                SyndBase synd)
Set the Prop instance with empty (no values) properties. This method is invoked to create a response for a propfind request containing a propname element

Parameters:
builder - the current WebDAVResponseBuilder which can be used to obtain context information
synd - instance of the synd to set the property names for
prop - the Prop instance to fill

setPropertyValue

public void setPropertyValue(WebDAVResponseBuilder builder,
                             Response response,
                             java.lang.Object property,
                             SyndBase synd)
Set the value of a provided property, and set the property on the response object with the correct status.

Applications should override this method with their own implementation in order to set the values of proprietary properties and to extend the default behavior.

see Response#setProperty(Object, int, String, Error) for a detailed description of the possible property values.

Examples:

if the property is DAV:getcontentlanguage then the type of the property is an instance of Getcontentlanguage, and setting it's value is performed as follows:

 if (property instanceof Getcontentlanguage) {
     ((Getcontentlanguage)property).setValue("en-us");
     response.setOk(property);
 }
 
if the property is K:myprop then the type of the property is an instance of org.w3c.dom.Element, and setting it's value is performed as follows:
 if (property instanceof Element) {
     ((Element)property).setTextContent("My Property Value!");
     response.setOk(property);
 }
 
If the requested property does not have a value, the application should call the Response#setPropertyNotFound(Object) method and pass it the property object, like so:
 response.setNotFound(property);
 

Parameters:
builder - the current WebDAVResponseBuilder which can be used to obtain context information
response - the Response instance that is to receive the property and its value
property - the property object. see Response.setProperty(Object, int, String, Error) for a detailed description of the possible property values
synd - an instance of synd (either feed or entry)


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.