View Javadoc

1   /*
2    * Copyright (c) 2006-2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.danube.webdav.xml.dav.request;
14  
15  import org.abstracthorizon.danube.webdav.xml.XMLParserHandler;
16  import org.abstracthorizon.danube.webdav.xml.dav.DAVAbstractXMLParser;
17  import org.abstracthorizon.danube.webdav.xml.dav.DAVFactory;
18  import org.abstracthorizon.danube.webdav.xml.dav.RequestProp;
19  
20  import org.xml.sax.Attributes;
21  import org.xml.sax.SAXException;
22  
23  /**
24   * This class models WebDAV's set property
25   *
26   * @author Daniel Sendula
27   */
28  public class Set extends DAVAbstractXMLParser {
29  
30      /** Nested request property */
31      protected RequestProp prop;
32  
33      /**
34       * Constructor
35       * @param parent request property
36       * @param factory factory
37       */
38      public Set(XMLParserHandler parent, DAVFactory factory) {
39          super(parent, factory);
40          prop = factory.newProp(this);
41      }
42  
43      @Override
44      public Object start(Object current, String tag, Attributes attributes) throws SAXException {
45          if ("prop".equals(tag)) {
46              return prop;
47          } else {
48              return super.start(current, tag, attributes);
49          }
50      }
51  
52      @Override
53      public String toString() {
54          return "Set[" + prop + "]";
55      }
56  }