// Path: src/org/dmfs/dav/DavParserContext.java
// public class DavParserContext extends ParserContext
// {
// 	private boolean mStrict = true;
// 	private boolean mKeepNotFoundProperties = false;
// 
// 
// 	/**
// 	 * Create a new {@link DavParserContext}.
// 	 */
// 	public DavParserContext()
// 	{
// 		mStrict = true;
// 	}
// 
// 
// 	/**
// 	 * Enable or disable strict parsing. Strict parsing will throw an error in some cases when the response is malformed. If strict parsing is not enabled the
// 	 * parser is supposed to make assumptions about the intent and continue if possible.
// 	 * 
// 	 * @param strict
// 	 *            <code>true</code> to be strict with errors, <code>false</code> otherwise.
// 	 * @return
// 	 */
// 	public DavParserContext setStrict(boolean strict)
// 	{
// 		mStrict = strict;
// 		return this;
// 	}
// 
// 
// 	/**
// 	 * Return whether strict parsing has been requested or not.
// 	 * 
// 	 * @return <code>true</code> to be strict with issues.
// 	 */
// 	public boolean isStrict()
// 	{
// 		return mStrict;
// 	}
// 
// 
// 	/**
// 	 * Set whether to allow dropping propstat elements with status {@link HttpStatus#NOT_FOUND}. In many cases there is no benefit in keeping them, so the
// 	 * default is not to store them.
// 	 * 
// 	 * @param keepNotFoundProperties
// 	 *            <code>true</code> to keep propstat elements with status {@link HttpStatus#NOT_FOUND}.
// 	 */
// 	public DavParserContext setKeepNotFoundProperties(boolean keepNotFoundProperties)
// 	{
// 		mKeepNotFoundProperties = keepNotFoundProperties;
// 		return this;
// 	}
// 
// 
// 	/**
// 	 * Returns whether to keep properties with status {@link HttpStatus#NOT_FOUND} or not.
// 	 * 
// 	 * @return <code>true</code> to keep such properties, <code>false</code> otherwise.
// 	 */
// 	public boolean getKeepNotFoundProperties()
// 	{
// 		return mKeepNotFoundProperties;
// 	}
// }


import org.dmfs.xmlobjects.pull.Recyclable;
import org.dmfs.xmlobjects.pull.XmlObjectPullParserException;
import org.dmfs.xmlobjects.serializer.SerializerContext;
import org.dmfs.xmlobjects.serializer.SerializerException;
import org.dmfs.xmlobjects.serializer.XmlObjectSerializer.IXmlChildWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import org.dmfs.dav.DavParserContext;
import org.dmfs.httpclientinterfaces.HttpStatus;
import org.dmfs.xmlobjects.ElementDescriptor;
import org.dmfs.xmlobjects.builder.AbstractObjectBuilder;
import org.dmfs.xmlobjects.builder.IObjectBuilder;
import org.dmfs.xmlobjects.pull.ParserContext;
		@Override
		public <V> PropStat update(ElementDescriptor<PropStat> descriptor, PropStat object, ElementDescriptor<V> childDescriptor, V child, ParserContext context)
			throws XmlObjectPullParserException
		{
			if (childDescriptor == WebDav.PROP)
			{
				// recycle old property map, if any
				context.recycle(WebDav.PROP, object.mProperties);
				// set new property list
				object.mProperties = (Map<ElementDescriptor<?>, Object>) child;
			}
			else if (childDescriptor == WebDav.STATUS)
			{
				object.mStatus = (Integer) child;
			}
			else if (childDescriptor == WebDav.ERROR)
			{
				object.mError = (Error) child;
			}
			else if (childDescriptor == WebDav.RESPONSEDESCRIPTION)
			{
				object.mResponseDescription = child.toString();
			}
			return object;
		};


		@Override
		public PropStat finish(ElementDescriptor<PropStat> descriptor, PropStat object, ParserContext context) throws XmlObjectPullParserException
		{
// Path: src/org/dmfs/dav/DavParserContext.java
// public class DavParserContext extends ParserContext
// {
// 	private boolean mStrict = true;
// 	private boolean mKeepNotFoundProperties = false;
// 
// 
// 	/**
// 	 * Create a new {@link DavParserContext}.
// 	 */
// 	public DavParserContext()
// 	{
// 		mStrict = true;
// 	}
// 
// 
// 	/**
// 	 * Enable or disable strict parsing. Strict parsing will throw an error in some cases when the response is malformed. If strict parsing is not enabled the
// 	 * parser is supposed to make assumptions about the intent and continue if possible.
// 	 * 
// 	 * @param strict
// 	 *            <code>true</code> to be strict with errors, <code>false</code> otherwise.
// 	 * @return
// 	 */
// 	public DavParserContext setStrict(boolean strict)
// 	{
// 		mStrict = strict;
// 		return this;
// 	}
// 
// 
// 	/**
// 	 * Return whether strict parsing has been requested or not.
// 	 * 
// 	 * @return <code>true</code> to be strict with issues.
// 	 */
// 	public boolean isStrict()
// 	{
// 		return mStrict;
// 	}
// 
// 
// 	/**
// 	 * Set whether to allow dropping propstat elements with status {@link HttpStatus#NOT_FOUND}. In many cases there is no benefit in keeping them, so the
// 	 * default is not to store them.
// 	 * 
// 	 * @param keepNotFoundProperties
// 	 *            <code>true</code> to keep propstat elements with status {@link HttpStatus#NOT_FOUND}.
// 	 */
// 	public DavParserContext setKeepNotFoundProperties(boolean keepNotFoundProperties)
// 	{
// 		mKeepNotFoundProperties = keepNotFoundProperties;
// 		return this;
// 	}
// 
// 
// 	/**
// 	 * Returns whether to keep properties with status {@link HttpStatus#NOT_FOUND} or not.
// 	 * 
// 	 * @return <code>true</code> to keep such properties, <code>false</code> otherwise.
// 	 */
// 	public boolean getKeepNotFoundProperties()
// 	{
// 		return mKeepNotFoundProperties;
// 	}
// }


// Path: src/org/dmfs/dav/rfc4918/PropStat.java
import org.dmfs.xmlobjects.pull.Recyclable;
import org.dmfs.xmlobjects.pull.XmlObjectPullParserException;
import org.dmfs.xmlobjects.serializer.SerializerContext;
import org.dmfs.xmlobjects.serializer.SerializerException;
import org.dmfs.xmlobjects.serializer.XmlObjectSerializer.IXmlChildWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import org.dmfs.dav.DavParserContext;
import org.dmfs.httpclientinterfaces.HttpStatus;
import org.dmfs.xmlobjects.ElementDescriptor;
import org.dmfs.xmlobjects.builder.AbstractObjectBuilder;
import org.dmfs.xmlobjects.builder.IObjectBuilder;
import org.dmfs.xmlobjects.pull.ParserContext;

		@Override
		public <V> PropStat update(ElementDescriptor<PropStat> descriptor, PropStat object, ElementDescriptor<V> childDescriptor, V child, ParserContext context)
			throws XmlObjectPullParserException
		{
			if (childDescriptor == WebDav.PROP)
			{
				// recycle old property map, if any
				context.recycle(WebDav.PROP, object.mProperties);
				// set new property list
				object.mProperties = (Map<ElementDescriptor<?>, Object>) child;
			}
			else if (childDescriptor == WebDav.STATUS)
			{
				object.mStatus = (Integer) child;
			}
			else if (childDescriptor == WebDav.ERROR)
			{
				object.mError = (Error) child;
			}
			else if (childDescriptor == WebDav.RESPONSEDESCRIPTION)
			{
				object.mResponseDescription = child.toString();
			}
			return object;
		};


		@Override
		public PropStat finish(ElementDescriptor<PropStat> descriptor, PropStat object, ParserContext context) throws XmlObjectPullParserException
		{
			boolean strict = !(context instanceof DavParserContext) || ((DavParserContext) context).isStrict();